@@ -34,7 +34,9 @@ repositories:
3434
3535## Mirror a DHI repository to your organization
3636
37- You must be an organization owner or editor to mirror repositories.
37+ To mirror repositories, you must be an organization owner or editor, or use a
38+ personal access token (PAT) or organization access token (OAT). See the CLI and
39+ Terraform tabs in the following sections for required permission scopes.
3840
3941- Image repositories: Mirroring lets you customize images by adding packages,
4042 OCI artifacts (such as custom certificates or additional tools), environment
@@ -66,10 +68,22 @@ It may take a few minutes for all the tags to finish mirroring.
6668{{< /tab >}}
6769{{< tab name="CLI" >}}
6870
69- Authenticate with ` docker login ` using your Docker credentials or a [ personal
71+ Authenticate with ` docker login ` using your Docker credentials, a [ personal
7072access token (PAT)] ( ../../security/access-tokens.md ) with ** Read & Write**
71- permissions. [ Organization access tokens
72- (OATs)] ( ../../enterprise/security/access-tokens.md ) are not supported.
73+ permissions, or an [ organization access token
74+ (OAT)] ( ../../enterprise/security/access-tokens.md ) . When using an OAT, the
75+ available operations depend on the token's permission scope:
76+
77+ - To list mirrored repositories, the OAT must have read (pull) access to the
78+ relevant repositories. Results are scoped to repositories the OAT can access.
79+ - To create a mirror to an existing destination repository, the OAT must have
80+ push access to that repository. To create a mirror to a new destination
81+ repository that doesn't yet exist, the OAT must have org-wide repository
82+ access (for example, ` <org>/* ` with pull or push). Repository-scoped access to
83+ the future repository name is not sufficient.
84+ - To stop mirroring, the OAT must have push access to the relevant repository.
85+ - OATs with public repository read-only access cannot list or manage mirrored
86+ repositories.
7387
7488Use the [ ` docker dhi mirror ` ] ( /reference/cli/docker/dhi/mirror/ ) command:
7589
@@ -127,7 +141,12 @@ provider "dhi" {
127141> [ !NOTE]
128142>
129143> Instead of specifying credentials in the provider block, you can set the
130- > ` DOCKER_USERNAME ` , ` DOCKER_PASSWORD ` , and ` DHI_ORG ` environment variables.
144+ > ` DOCKER_USERNAME ` , ` DOCKER_PASSWORD ` , and ` DHI_ORG ` environment variables. You
145+ > can also authenticate using an organization access token (OAT) in place of a
146+ > password. Set ` DOCKER_USERNAME ` to your organization namespace and
147+ > ` DOCKER_PASSWORD ` to the OAT. When using an OAT, the same permission scopes
148+ > apply as with the CLI: read (pull) access is required to list mirrors, and
149+ > push access is required to create or delete them.
131150
132151Then, define a ` dhi_mirror ` resource for each repository you want to mirror:
133152
@@ -194,10 +213,11 @@ updates. You can still use the last images or charts that were mirrored.
194213{{< /tab >}}
195214{{< tab name="CLI" >}}
196215
197- Authenticate with ` docker login ` using your Docker credentials or a [ personal
216+ Authenticate with ` docker login ` using your Docker credentials, a [ personal
198217access token (PAT)] ( ../../security/access-tokens.md ) with ** Read & Write**
199- permissions. [ Organization access tokens
200- (OATs)] ( ../../enterprise/security/access-tokens.md ) are not supported.
218+ permissions, or an [ organization access token
219+ (OAT)] ( ../../enterprise/security/access-tokens.md ) with push access to the
220+ relevant repository.
201221
202222Use the [ ` docker dhi mirror ` ] ( /reference/cli/docker/dhi/mirror/ ) command:
203223
0 commit comments