Private Registry

The private registry provides the image storage and searching for Humpback.

Prerequisites

  • Docker version is 1.8.3 or later

  • Docker official registry Distribution, recommended2.5.1 or higher

Start the Registry

Using the 2.5.1 version as an example to show how to run docker registry.

The image name of Docker official registry Distribution at hub.docker.com is registry

1、Pull the registry image to the local

  1. $ docker pull registry:2.5.1

2、Start the registry service

  1. $ docker run -d -p 5000:5000 --restart=always \
  2. -v /var/lib/registry/:/var/lib/registry/ \
  3. -v /etc/docker/registry/config.yml:/etc/docker/registry/config.yml \
  4. --name registry \
  5. registry:2.5.1

Refer to the registry configuration instructions configuration.md

3、Verify the registry service

  1. $ curl http://localhost:5000/v2/_catalog
  2. {"repositories":[]}

If you can access the registry interface _catalog, the service starts successfully.

Configure the Docker

You need to modify the Docker configuration before pull and push images.

In the following configuration instructions, <registry_server> is the IP address or host domain name of the registry server.

  • CentOS 6

    Modify /etc/sysconfig/docker

    In the other_args option add “—insecure-registry <registry_server>:5000”

    If there is no other_args option for Docker version differences, need to find INSECURE_REGISTRY option and modified to: INSECURE_REGISTRY=”<registry_server>:5000”

    Note: Part of the docker version of 1.10.x or higher has default toCentOS 7 installation source, if the system is CentOS 7 also need to modify thedocker.service file.

    In the CentOS 7 system, first see if there is aEnvironmentFile configuration in /usr/lib/systemd/system/docker.service.

C6配置

File content may be slightly different, just pay attention to the EnvironmentFile andExecStart part in the red box, make sure to link to the configuration file path and the relevant environment variable INSECURE_REGISTRY.

  • Ubuntu

    Modify /etc/default/docker

    Find the INSECURE_REGISTRY option and change to: INSECURE_REGISTRY =” <registry_server>: 5000 “

Restart the Docker local service after the configuration, and check whether the configuration takes effect. If the process appears, the --insecure-registry parameter indicates that the configuration takes effect.

  1. $ service docker restart
  2. $ ps aux | grep docker
  3. root 5003 1.8 2.0 520284 42360 ? Ssl 15:59 0:00 /usr/bin/dockerd -H fd:// --insecure-registry 192.168.1.10:5000

Add Registry to Humpback

C6配置

Log in to Humpback as an administrator and expand the left Manage and click System Config. Enter the system configuration interface, check the Enable Private Registry, and fill in the private registry service address and Save.