Deploy a private registry

Docker Registry

  • Pull the Docker official registry image

We use 192.168.2.80 as Humpback private registry server.

  1. 192.168.2.80
  2. $ mkdir -p /var/lib/registry
  3. $ docker pull registry:2.5.1
  • Start the registry service

Please copy the configuration file to /etc/docker/registry/config.yml. For registry configuration instructions, see configuration.md

If registry need to support CORS, change the http entry inconfig.yml as follows:

  1. http:
  2. addr: :5000
  3. secret: abcdfg
  4. headers:
  5. X-Content-Type-Options: [nosniff]
  6. Access-Control-Allow-Headers: ['Origin,Accept,Content-Type,Authorization']
  7. Access-Control-Allow-Origin: ['*']
  8. Access-Control-Allow-Methods: ['GET,POST,PUT,DELETE']

Start the registry

  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.6.2
  • Check the registry state. Check the _catalog API as below:
  1. $ docker ps -a
  2. CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
  3. a0e4c87eef5b registry:2.6.2 "/entrypoint.sh /etc/" 15 minutes ago 45 seconds ago 0.0.0.0:5000->5000/tcp registry
  4. $ curl http://192.168.2.80:5000/v2/_catalog
  5. {"repositories":[]}