lihongjie0209 / myblog

4 stars 0 forks source link

Harbor缓存代理配置 #256

Open lihongjie0209 opened 3 years ago

lihongjie0209 commented 3 years ago

To set up a proxy cache, a Harbor system administrators can create a proxy cache project that connects to a target registry using a registry endpoint.

A proxy cache project is able to use the same features available to a normal Harbor project, except that you are not able to push images to a proxy cache project. For more information on projects, see the Working with Projects documentation.

  1. Before creating a proxy cache project, create a Docker Hub or Harbor registry endpoint for the proxy cache project to use. See how to create a registry endpoint.

    Proxy cache projects can pull every image from the target registry that the access account you configure in the registry endpoint has access to. This means that Harbor users with access to the proxy cache project are able to pull any image available to the access account in the target repository.

  2. On the Projects page, click New Project and configure the new project information. See the Create Projects documentation for more details.

  3. Click the Proxy Cache slider and then select your registry endpoint from the drop-down that appears.

    add proxy cache project

  4. Click OK.

You can view all available proxy cache projects from the Projects page.

By default, Harbor creates a 7 day retention policy for each new proxy cache project. See more about Tag Retention Policies.

To start using the proxy cache, configure your docker pull commands or pod manifests to reference the proxy cache project by adding <harbor_servername>/<proxy_project_name>/ as a prefix to the image tag. For example:

> docker pull <harbor_server_name>/<proxy_project_name>/goharbor/harbor-core:dev

To pull official images or from single level repositories, make sure to include the ‘library’ namespace.

> docker pull <harbor_server_name>/<proxy_project_name>/library/hello-world:latest