Skip to content

Commit 7543797

Browse files
authored
docs(ci): clarify credentials setup for DBC CI/CD (#22587)
## Description This PR updates the Docker Build Cloud CI documentation to clarify the setup of credentials for CI/CD pipelines. The changes include: - Renaming the section to “Setting up credentials for CI/CD” and integrating guidance on both access tokens and the required username (`DOCKER_USER`). - Explaining when to use an organization access token (OAT) versus a personal access token (PAT), and which value to use for `DOCKER_USER` in each case. - Updating the build timeout note from 2 hours to 90 minutes. ## Related issues or tickets N/A – Documentation improvement and clarification. ## Reviews - [ ] Technical review — Confirm technical accuracy of credential setup and variable usage. - [ ] Editorial review — Check for clarity, consistency, and adherence to Docker copy guidelines. - [ ] Product review — Ensure the documentation aligns with product requirements and user needs.
1 parent 0530b65 commit 7543797

File tree

1 file changed

+43
-20
lines changed
  • content/manuals/build-cloud

1 file changed

+43
-20
lines changed

content/manuals/build-cloud/ci.md

Lines changed: 43 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -29,30 +29,53 @@ See [Loading build results](./usage/#loading-build-results) for details.
2929

3030
> [!NOTE]
3131
>
32-
> Builds on Docker Build Cloud have a timeout limit of two hours. Builds that
33-
> run for longer than two hours are automatically cancelled.
32+
> Builds on Docker Build Cloud have a timeout limit of 90 minutes. Builds that
33+
> run for longer than 90 minutes are automatically cancelled.
3434
35-
## CI platform examples
35+
## Setting up credentials for CI/CD
3636

37-
### GitHub Actions
37+
To enable your CI/CD system to build and push images using Docker Build Cloud, provide both an access token and a username. The type of token and the username you use depend on your account type and permissions.
38+
39+
- If you are an organization administrator or have permission to create [organization access tokens (OAT)](../security/for-admins/access-tokens.md), use an OAT and set `DOCKER_USER` to your Docker Hub organization name.
40+
- If you do not have permission to create OATs or are using a personal account, use a [personal access token (PAT)](/security/for-developers/access-tokens/) and set `DOCKER_USER` to your Docker Hub username.
41+
42+
### Creating access tokens
43+
44+
#### For organization accounts
45+
46+
If you are an organization administrator:
47+
48+
1. Create an [organization access token (OAT)](../security/for-admins/access-tokens.md):
49+
- The token must have these permissions:
50+
- **cloud-connect** scope
51+
- **Read public repositories** permission
52+
- **Repository access** with **Image push** permission for the target repository:
53+
- Expand the **Repository** drop-down.
54+
- Select **Add repository** and choose your target repository.
55+
- Set the **Image push** permission for the repository.
56+
57+
If you are not an organization administrator:
58+
59+
- Ask your organization administrator for an access token with the permissions listed above, or use a personal access token.
60+
61+
#### For personal accounts
62+
63+
1. Create a [personal access token (PAT)](/security/for-developers/access-tokens/):
64+
- Create a new token with **Read & write** access.
65+
- Note: Building with Docker Build Cloud only requires read access, but you need write access to push images to a Docker Hub repository.
66+
67+
68+
## CI platform examples
3869

3970
> [!NOTE]
4071
>
41-
> Version 4.0.0 and later of `docker/build-push-action` and
42-
> `docker/bake-action` builds images with [provenance attestations by
43-
> default](/manuals/build/ci/github-actions/attestations.md#default-provenance). Docker
44-
> Build Cloud automatically attempts to load images to the local image store if
45-
> you don't explicitly push them to a registry.
46-
>
47-
> This results in a conflicting scenario where if you build a tagged image
48-
> without pushing it to a registry, Docker Build Cloud attempts to load images
49-
> containing attestations. But the local image store on the GitHub runner
50-
> doesn't support attestations, and the image load fails as a result.
72+
> In your CI/CD configuration, set the following variables:
73+
> - `DOCKER_PAT` — your access token (PAT or OAT)
74+
> - `DOCKER_USER` — your Docker Hub username (for PAT) or organization name (for OAT)
5175
>
52-
> If you want to load images built with `docker/build-push-action` together
53-
> with Docker Build Cloud, you must disable provenance attestations by setting
54-
> `provenance: false` in the GitHub Action inputs (or in `docker-bake.hcl` if
55-
> you use Bake).
76+
> This ensures your builds authenticate correctly with Docker Build Cloud.
77+
78+
### GitHub Actions
5679

5780
```yaml
5881
name: ci
@@ -381,7 +404,7 @@ mkdir -vp ~/.docker/cli-plugins/
381404
curl --silent -L --output ~/.docker/cli-plugins/docker-buildx $BUILDX_URL
382405
chmod a+x ~/.docker/cli-plugins/docker-buildx
383406

384-
# Login to Docker Hub. For security reasons $DOCKER_PAT should be a Personal Access Token. See https://docs.docker.com/security/for-developers/access-tokens/
407+
# Login to Docker Hub. For security reasons $DOCKER_PAT should be a Personal Access Token. See https://docs.docker.com/build-cloud/ci/#creating-access-tokens
385408
echo "$DOCKER_PAT" | docker login --username $DOCKER_USER --password-stdin
386409

387410
# Connect to your builder and set it as the default builder
@@ -426,7 +449,7 @@ curl --silent -L --output ~/.docker/cli-plugins/docker-compose $COMPOSE_URL
426449
chmod a+x ~/.docker/cli-plugins/docker-buildx
427450
chmod a+x ~/.docker/cli-plugins/docker-compose
428451

429-
# Login to Docker Hub. For security reasons $DOCKER_PAT should be a Personal Access Token. See https://docs.docker.com/security/for-developers/access-tokens/
452+
# Login to Docker Hub. For security reasons $DOCKER_PAT should be a Personal Access Token. See https://docs.docker.com/build-cloud/ci/#creating-access-tokens
430453
echo "$DOCKER_PAT" | docker login --username $DOCKER_USER --password-stdin
431454

432455
# Connect to your builder and set it as the default builder

0 commit comments

Comments
 (0)