Skip to main content

Proxy Repository for Docker

To reduce duplicate downloads and improve download speeds for your developers and CI servers, you should proxy any registry you use for Docker images.

Basic Steps to Proxy a Docker Registry

To proxy a Docker registry, you simply create a new docker (proxy) as documented in Repository Management.

Minimal configuration steps are as follows:

  1. Define a Name

  2. Define a URL of the remote registry you want to proxy for Remote Storage

  3. Enable Docker V1 API support if required by the remote repository

  4. Select the correctDocker index

  5. Further configure Location of Docker indexif needed

  6. Select Blob store for Storage

Steps to Configure a Proxy for Docker Hub

Docker Hub is the most common registry used by all image creators and consumers.

In order to configure a proxy for Docker Hub, you create a new docker (proxy) as documented in Repository Management and make the following configurations:

  1. Define a Name

  2. Define the URL for Remote Storage as "https://registry-1.docker.io"

  3. Enable Docker V1 API support

  4. For the Docker index, select Use Docker Hub

  5. Select Blob store for storage

Optional Repository Connector

If you intend users to access the proxy repository directly, you may wish to configure a Repository Connector as explained in SSL and Repository Connector Configuration. This is not necessary for proxy content that is accessed via a Docker group.

Configuring a Correct Remote Storage and Docker Index URL Pair

It is important to configure a correct pair of Remote Storage URL and Docker Index URL. If there is a mismatch, search results potentially will not reflect the remote repository's content, and other problems can occur.

The proxy configuration for a Docker proxy repository includes a configuration URL to access the Docker Index. The index is used for requests related to searches, users, Docker tokens and other aspects.

The same provider typically co-hosts the registry and the index; however, they can use different URLs. For example, the index for Docker Hub is exposed at https://index.docker.io/. By selecting the default option of Use proxy registry (specified above), Nexus Repository will attempt to retrieve any index data from the same URL configured as theRemote StorageURL.

The option to Use Docker Hub fulfills any index-related requests by querying the Docker Hub index at https://index.docker.io/. This configuration is desired when the proxy repository is Docker Hub itself or any of its mirrors.

The option to use a Custom index allows you to specify the URL of the index for the remote repository.