Skip to content

Commit 0407c9b

Browse files
kylegalbraithgithub-actions[bot]
authored andcommitted
Update docs content from https://github.com/depot/app
1 parent 60d7d12 commit 0407c9b

File tree

11 files changed

+315
-162
lines changed

11 files changed

+315
-162
lines changed

Diff for: content/cache/authentication.mdx

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ Depot Cache supports authenticating with user tokens and organization tokens. Ad
1919
For specific details on how to configure your build tools to authenticate with Depot Cache, refer to the following guides:
2020

2121
- [Bazel](/docs/cache/reference/bazel)
22+
- [Go](/docs/cache/reference/gocache)
2223
- [Gradle](/docs/cache/reference/gradle)
2324
- [Pants](/docs/cache/reference/pants)
2425
- [sccache](/docs/cache/reference/sccache)

Diff for: content/cache/overview.mdx

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Depot Cache
33
ogTitle: Overview of Depot remote caching
4-
description: Learn how to use Depot remote cache for exponentially faster builds for tools like Bazel, Turborepo, sccache, Pants, and Gradle.
4+
description: Learn how to use Depot remote cache for exponentially faster builds for tools like Bazel, Go, Turborepo, sccache, Pants, and Gradle.
55
---
66

77
import {CacheToolLogoGrid} from '~/components/docs/CacheToolLogoGrid'
@@ -12,7 +12,7 @@ One of the biggest benefits of adopting advanced build tools like Bazel is the a
1212

1313
## Supported tools
1414

15-
Depot Cache integrates with build tools that support remote caching like Bazel, Turborepo, sccache, Pants, and Gradle. For information about how to configure each tool to use Depot Cache, see the tool documentation:
15+
Depot Cache integrates with build tools that support remote caching like Bazel, Go, Turborepo, sccache, Pants, and Gradle. For information about how to configure each tool to use Depot Cache, see the tool documentation:
1616

1717
<CacheToolLogoGrid />
1818

Diff for: content/cache/reference/gocache.mdx

+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
---
2+
title: Go Cache
3+
ogTitle: Remote caching for Go builds and tests
4+
description: Learn how to use Depot remote caching for Go
5+
---
6+
7+
## Configuring Go to use Depot Cache
8+
9+
Depot Cache can be used with Go from Depot's managed GitHub Actions runners, from your local machine, or from any CI/CD system.
10+
11+
### From Depot-managed Actions runners
12+
13+
[Depot GitHub Actions runners](/docs/github-actions/overview) are pre-configured to use Depot Cache with Go - each runner is launched with the `GOCACHEPROG` environment variable pre-populated with the connection details for Depot Cache.
14+
15+
If this automatic configuration is incompatible with your specific setup, you can disable automatic configuration in your organization settings page and manually configure `GOCACHEPROG` to use Depot Cache as described below.
16+
17+
### From your local machine or any CI/CD system
18+
19+
To manually configure Go to use Depot Cache, set the `GOCACHEPROG` in your environment:
20+
21+
```shell
22+
export GOCACHEPROG="depot gocache"
23+
```
24+
25+
The `depot` CLI will need to have [authorization](/docs/cli/authentication) to write to the cache.
26+
27+
If you are a member of multiple organizations, and you are authenticating with a user token, you must instead specify which organization should be used for cache storage as follows:
28+
29+
```shell
30+
export GOCACHEPROG='depot gocache --organization ORG_ID'
31+
```
32+
33+
To clean the cache, you can use the typical `go clean` workflow:
34+
35+
```shell
36+
go clean -cache
37+
```
38+
39+
To set verbose output, add the --verbose option:
40+
41+
```shell
42+
export GOCACHEPROG='depot gocache --verbose'
43+
```
44+
45+
## Using Depot Cache with Go
46+
47+
Once Go is configured to use Depot Cache, you can then run your builds as you normally would. Go will automatically communicate with `GOCACHEPROG` to fetch from Depot Cache and reuse any stored build artifacts from your previous builds.

Diff for: content/cli/authentication.mdx

+1
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ To add a trust relationship for GitHub Actions, you can go through the following
4343
5. Enter a GitHub User or Organization for the trust relationship
4444
6. Enter the name of the GitHub repository that will build images via Depot (Note: this is the repository name, not the full URL and it must match the repository name exactly)
4545
7. Click Add trust relationship
46+
8. Ensure your workflow has permission to use this OIDC trust relationship by setting the permission `id-token: write`.
4647

4748
### Adding a trust relationship for CircleCI
4849

Diff for: content/cli/reference.mdx

+42-6
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ If you want to build a specific target in the bake file, you can specify it in t
101101
depot bake -f docker-bake.hcl original
102102
```
103103

104-
You can also save all of the targets built in a bake or compose file to the [ephemeral registry](/docs/container-builds/how-to-guides/ephemeral-registry) for later use with the `--save` flag:
104+
You can also save all of the targets built in a bake or compose file to the [Depot Registry](/docs/registry/overview) for later use with the `--save` flag:
105105

106106
```shell
107107
depot bake -f docker-bake.hcl --save
@@ -164,7 +164,7 @@ This command accepts all the command line flags as Docker's `docker buildx bake`
164164
| `provenance` | Shorthand for "--set=\*.attest=type=provenance" |
165165
| `pull` | Always attempt to pull all referenced images |
166166
| `push` | Shorthand for "--set=\*.output=type=registry" |
167-
| `save` | Saves the build to the Depot ephemeral registry
167+
| `save` | Saves the build to the Depot Registry
168168
| `sbom` | Shorthand for "--set=\*.attest=type=sbom" |
169169
| `sbom-dir` | Directory to store SBOM attestations |
170170
| `set` | Override target value (e.g., "targetpattern.key=value") |
@@ -236,7 +236,7 @@ This command accepts all the command line flags as Docker's `docker buildx build
236236
| `pull` | Always attempt to pull all referenced images |
237237
| `push` | Shorthand for "--output=type=registry" |
238238
| `quiet` | Suppress the build output and print image ID on success |
239-
| `save` | Saves the build to the Depot ephemeral registry |
239+
| `save` | Saves the build to the Depot Registry |
240240
| `sbom` | Shorthand for "--attest=type=sbom" |
241241
| `sbom-dir` | Directory to store SBOM attestations |
242242
| `secret` | Secret to expose to the build (format: "id=mysecret[,src=/local/secret]") |
@@ -270,6 +270,42 @@ Reset the cache of a specific project ID
270270
depot cache reset --project 12345678910
271271
```
272272

273+
### `depot gocache`
274+
275+
Configure Go tools to use Depot Cache. The Go tools will use the remote cache service to store and retrieve build artifacts.
276+
277+
_Note: This requires Go 1.24 or later._
278+
279+
Set the environment variable `GOCACHEPROG` to `depot gocache` to configure Go to use Depot Cache.
280+
281+
```shell
282+
export GOCACHEPROG='depot gocache'
283+
```
284+
285+
Next, run your Go build commands as usual.
286+
287+
```shell
288+
go build ./...
289+
```
290+
291+
To set verbose output, add the --verbose option:
292+
293+
```shell
294+
export GOCACHEPROG='depot gocache --verbose'
295+
```
296+
297+
To clean the cache, you can use the typical `go clean` workflow:
298+
299+
```shell
300+
go clean -cache
301+
```
302+
303+
If you are in multiple Depot organizations and want to specify the organization, you can use the `--organization` flag.
304+
305+
```shell
306+
export GOCACHEPROG='depot gocache --organization ORG_ID'
307+
```
308+
273309
### `depot configure-docker`
274310

275311
Configure Docker to use Depot's remote builder infrastructure. This command installs Depot as a Docker CLI plugin (i.e., `docker depot ...`), sets the Depot plugin as the default Docker builder (i.e., `docker build`), and activates a buildx driver (i.e. `docker buildx buildx ...`).
@@ -399,7 +435,7 @@ depot list projects
399435

400436
### `depot pull`
401437

402-
Pull an image from the ephemeral registry by build ID in a project.
438+
Pull an image from the Depot Registry by build ID in a project.
403439

404440
**Example**
405441

@@ -437,7 +473,7 @@ Additional flags that can be used with this command.
437473

438474
### `depot pull-token`
439475

440-
Generate a short-lived token to pull an image from the ephemeral registry.
476+
Generate a short-lived token to pull an image from the Depot Registry.
441477

442478
**Example**
443479

@@ -466,7 +502,7 @@ Additional flags that can be used with this command.
466502

467503
### `depot push`
468504

469-
Push an image from the ephemeral registry to a remote registry. It uses registry credentials stored in Docker when pushing to registries. If you have not already authenticated with your registry, you should do so with `docker login` before running `depot push`.
505+
Push an image from the Depot Registry to another registry. It uses registry credentials stored in Docker when pushing to registries. If you have not already authenticated with your registry, you should do so with `docker login` before running `depot push`.
470506

471507
**Example**
472508

Diff for: content/container-builds/how-to-guides/docker-compose.mdx

+4-4
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ However, `depot configure-docker` does directly integrate with any tools that us
9898

9999
## Building and testing `docker compose` on GitHub Actions
100100

101-
With the `depot/bake-action` action and the `--save` flag, we can build all of the services in a Compose file in parallel and save them to the Depot ephemeral registry. Then, with the `depot/pull-action`, we can pull all of the images back into the local Docker daemon for testing in subsequent jobs.
101+
With the `depot/bake-action` action and the `--save` flag, we can build all of the services in a Compose file in parallel and save them to the Depot Registry. Then, with the `depot/pull-action`, we can pull all of the images back into the local Docker daemon for testing in subsequent jobs.
102102

103103
```yaml
104104
name: Depot example compose
@@ -117,7 +117,7 @@ jobs:
117117
steps:
118118
- uses: actions/checkout@v4
119119
- uses: depot/setup-action@v1
120-
- name: Build, cache, and save all compose images to the depot ephemeral registry.
120+
- name: Build, cache, and save all compose images to the Depot Registry.
121121
uses: depot/bake-action@v1
122122
id: bake
123123
with:
@@ -130,14 +130,14 @@ jobs:
130130
steps:
131131
- uses: actions/checkout@v4
132132
- uses: depot/setup-action@v1
133-
- name: Pull all compose service images locally from the ephemeral registry.
133+
- name: Pull all compose service images locally from the Depot Registry.
134134
uses: depot/pull-action@v1
135135
with:
136136
build-id: ${{ needs.build-services.outputs.build-id }}
137137
- name: Run compose up (images should not rebuild)
138138
run: |
139139
docker compose up -d
140-
- name: If successful push the srv1 compose service target image to ghcr.io from ephemeral registry
140+
- name: If successful, push the srv1 compose service target image to ghcr.io from Depot Registry
141141
run: |
142142
echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io -u $ --password-stdin
143143
depot push --target srv1 -t ghcr.io/depot/srv1:latest ${{ steps.build.outputs.build-id }}

Diff for: content/container-builds/how-to-guides/ephemeral-registry.mdx

-114
This file was deleted.

Diff for: content/container-builds/overview.mdx

+3-3
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,11 @@ We can accelerate your image builds for other developer tools like Dev Container
6868

6969
We offer autoscaling for our remote container builds. By default, all builds for a project are routed to a single BuildKit host per architecture you're building. With build autoscaling, you can configure the maximum number of builds to run on a single host before launching another host with a copy of your layer cache. This can help you parallelize builds across multiple hosts and reduce build times even further by giving them dedicated resources.
7070

71-
### Ephemeral registry
71+
### Depot Registry
7272

73-
We offer a built-in ephemeral registry that you can use to save the images from your `depot build` and `depot bake` commands to a temporary registry. You can then pull those images back down or push them to your final registry as you see fit.
73+
We offer a built-in registry that you can use to save the images from your `depot build` and `depot bake` commands to a registry. You can then pull those images back down or push them to your final registry as you see fit.
7474

75-
[Learn more about the ephemeral registry](/docs/container-builds/how-to-guides/ephemeral-registry)
75+
[Learn more about the Depot Registry](/docs/registry/overview)
7676

7777
## How does it work?
7878

0 commit comments

Comments
 (0)