From 5e3d3afb1184b91c7aaac8618cc5ca1a5fe85bc7 Mon Sep 17 00:00:00 2001 From: int32bit Date: Mon, 16 May 2016 18:13:28 +0800 Subject: [PATCH 1/2] Configure Harbor as a mirror registry --- docs/installation_guide.md | 28 ++++++++++++++++++++++++++++ docs/user_guide.md | 0 2 files changed, 28 insertions(+) mode change 100755 => 100644 docs/user_guide.md diff --git a/docs/installation_guide.md b/docs/installation_guide.md index cfc0a2c01..a76f0a804 100644 --- a/docs/installation_guide.md +++ b/docs/installation_guide.md @@ -75,6 +75,34 @@ For information on how to use Harbor, please refer to [User Guide of Harbor](use #### Configuring Harbor with HTTPS Access Because Harbor does not ship with any certificates, it uses HTTP by default to serve registry requests. This makes it relatively simple to configure, especially for a development or testing environment. However, it is highly recommended that security be enabled for any production environment. Refer to [Configuring Harbor with HTTPS Access](configure_https.md) if you want to enable HTTPS access to Harbor. +#### Configuring Harbor as a local registry mirror +The Harbor runs as a local private registry by default, it can be easily configured to run as a local registry mirror, which can keep most of the redundant image fetch traffic on your local network. You just need to edit `config/registry/config.yml` after execute `./prepare`, and append a `proxy` section as follows: + +``` +proxy: + remoteurl: https://registry-1.docker.io +``` +In order to access private images on the Docker Hub, a username and password can be supplied: + +``` +proxy: + remoteurl: https://registry-1.docker.io + username: [username] + password: [password] +``` +You will need to pass the `--registry-mirror` option to your Docker daemon on startup: + +``` +docker --registry-mirror=https:// daemon +``` +For example, if your mirror is serving on `http:/reg.yourdomain.com`, you would run: + +``` +docker --registry-mirror=https://reg.yourdomain.com daemon +``` + +Refer to the [Registry as a pull through cache](https://github.com/docker/distribution/blob/master/docs/mirror.md) for detail information. + ## Installing Harbor via a pre-built installation package A pre-built installation package of each release can be downloaded from the [release page](https://github.com/vmware/harbor/releases). After downloading the package file **harbor-<version>.tgz** , extract files in the package. diff --git a/docs/user_guide.md b/docs/user_guide.md old mode 100755 new mode 100644 From 36f17ef1e110004b4bd27c5e580de2e0ae9fdc0e Mon Sep 17 00:00:00 2001 From: int32bit Date: Tue, 17 May 2016 09:24:21 +0800 Subject: [PATCH 2/2] Configure Harbor to support multiple storage backend --- docs/installation_guide.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/docs/installation_guide.md b/docs/installation_guide.md index a76f0a804..38b34f4ab 100644 --- a/docs/installation_guide.md +++ b/docs/installation_guide.md @@ -103,6 +103,22 @@ docker --registry-mirror=https://reg.yourdomain.com daemon Refer to the [Registry as a pull through cache](https://github.com/docker/distribution/blob/master/docs/mirror.md) for detail information. +#### Configuring storage backend + +By default, the Harbor store images on your local filesystem. In production environment, you may consider using higher available storage backend instead of the local filesystem, like S3, Openstack Swift, Ceph, etc. Fortunately, the Registry supports multiple storage backend, refer to the [Registry Configuration Reference](https://docs.docker.com/registry/configuration/) for detail information. All you need to do is update the section of `storage`, and fill in the fields according to your specied backend. For example, if you use Openstack Swift as your storage backend, the file may look like this: + +``` +storage: + swift: + username: admin + password: ADMIN_PASS + authurl: http://keystone_addr:35357/v3 + tenant: admin + domain: default + region: regionOne + container: docker_images +``` + ## Installing Harbor via a pre-built installation package A pre-built installation package of each release can be downloaded from the [release page](https://github.com/vmware/harbor/releases). After downloading the package file **harbor-<version>.tgz** , extract files in the package.