mirror of https://github.com/docker/docs.git
Merge pull request #848 from docker/dtr-pull-mirroring
Update pull mirroring page to include UI changes
This commit is contained in:
commit
4175fdc6f8
Binary file not shown.
After Width: | Height: | Size: 86 KiB |
|
@ -5,24 +5,42 @@ keywords: registry, promotion, mirror
|
|||
---
|
||||
|
||||
Docker Trusted Registry allows you to set up a mirror of a repository by
|
||||
constantly polling it and pulling new images that get pushed into it.
|
||||
|
||||
This way you can ensure your images are persisted across different DTR
|
||||
deployments for high availability.
|
||||
It also makes it easy to create a development pipeline that allows different
|
||||
users access to an image without having to grant them access to a DTR deployment
|
||||
they should not have access to.
|
||||
constantly polling it and pulling new image tags as they are pushed. This ensures your images are replicated across different registries for high availability. It also makes it easy to create a development pipeline that allows different
|
||||
users access to a certain image without giving them access to everything in the remote registry.
|
||||
|
||||

|
||||
|
||||
To mirror a repository, start by [creating a repository](../manage-images/index.md)
|
||||
in the DTR deployment that will serve as the mirror.
|
||||
in the DTR deployment that will serve as your mirror. Previously, you were only able to set up pull mirroring from the API. Starting in DTR 2.6, you can also mirror and pull from a remote DTR or Docker Hub repository.
|
||||
|
||||
Setting up a mirror is only available from the DTR API.
|
||||
## Pull mirroring on the web interface
|
||||
|
||||
The easiest way to use the DTR API is to use the interactive documentation
|
||||
that's available in the DTR web UI. In the left navigation bar of the
|
||||
**DTR web UI**, click **API**.
|
||||
To get started:
|
||||
|
||||
1. Navigate to `https://<dtr-url>` and log in with your UCP credentials.
|
||||
|
||||
2. Select **Repositories** on the left navigation pane, and then click on the name of the repository that you want to view. Note that you will have to click on the repository name following the `/` after the specific namespace for your repository.
|
||||
|
||||
3. Select the **Mirrors** tab and click **New mirror policy**.
|
||||
|
||||
4. In the ***New Mirror*** page, specify the following details:
|
||||
* Mirror direction: Choose "Pull from remote registry"
|
||||
* Registry type: You can choose between **Docker Trusted Registry** and **Docker Hub**. If you choose DTR, enter your DTR URL. Otherwise, **Docker Hub** defaults to `https://index.docker.io`.
|
||||
* Username and Password or access token: Your credentials in the remote repository you wish to poll from. To use an access token instead of your password, see [authentication token](../access-tokens.md).
|
||||
* Repository: Enter the `namespace` and the `repository name after the `/`.
|
||||
* Show advanced settings: Enter the TLS details for the remote repository or check `Skip TLS verification`.
|
||||
|
||||
|
||||
{: .img-fluid .with-border}
|
||||
|
||||
|
||||
|
||||
5. Click **Connect**.
|
||||
|
||||
|
||||
## Pull mirroring on the API
|
||||
|
||||
There are different ways to send your DTR API requests. To explore the different API resources and endpoints from the web interface, click **API** on the bottom left navigation pane.
|
||||
|
||||
Search for the endpoint:
|
||||
|
||||
|
@ -30,20 +48,31 @@ Search for the endpoint:
|
|||
POST /api/v0/repositories/{namespace}/{reponame}/pollMirroringPolicies
|
||||
```
|
||||
|
||||
Click **Try it out** and fill-in the details. 'Namespace' and 'reponame' refer
|
||||
to the repository that will be the mirror.
|
||||
The other fields are the remote repository to poll from and the credentials
|
||||
to use. As a best practice, use a service account just for this purpose. Instead
|
||||
of providing the password for that account, you should pass a
|
||||
[authentication token](../access-tokens.md)
|
||||
Click **Try it out** and enter your HTTP request details. `namespace` and `reponame` refer
|
||||
to the repository that will be the mirror. The other fields refer to the remote repository to poll from and the credentials to use. As a best practice, use a service account just for this purpose. Instead of providing the password for that account, you should pass an
|
||||
[authentication token](../access-tokens.md).
|
||||
|
||||
If the DTR deployment to mirror images from is using self-signed certificates or
|
||||
If the Docker Trusted or Hub registry to mirror images from is using self-signed certificates or
|
||||
certificates signed by your own certificate authority, you also need to provide
|
||||
the public key certificate for that certificate authority.
|
||||
You can get it by accessing `https://<dtr-domain>/ca`.
|
||||
|
||||
Click **execute** and make sure you got an HTTP 201 response, signaling that the
|
||||
repository is polling the source repository every couple of minutes
|
||||
Click **Execute**. On success, the API returns an `HTTP 201` response.
|
||||
|
||||
> Known Issues
|
||||
>
|
||||
> For issues related to pull mirroring, see Known Issues section of [DTR 2.6.0 release notes](../../release-notes).
|
||||
|
||||
## Review the poll mirror job log
|
||||
|
||||
Once configured, the system polls for changes in the remote repository and runs the `poll_mirror` job every 30 minutes. On success, the system will pull in new images and mirror them in your local repository. Starting in DTR 2.6, you can filter for `poll_mirror` jobs to review when it was last ran. To manually trigger the job and force pull mirroring, use the `POST /api/v0/jobs` API endpoint and specify `poll_mirror` as your action.
|
||||
|
||||
```
|
||||
curl -X POST "https:/<dtr-url>/api/v0/jobs" -H "accept: application/json" -H "content-type: application/json" -d "{ \"action\": \"poll_mirror\"}"
|
||||
```
|
||||
|
||||
See [Manage Jobs](../../admin/manage-jobs/job-queue/) to learn more about job management within DTR.
|
||||
|
||||
|
||||
## Where to go next
|
||||
|
||||
|
|
Loading…
Reference in New Issue