May 25, 2015

Deploy a private Docker registry including mirror and web frontend

UPDATE 2016-02-29

  • Adjusted to registry v2
  • added web frontend


Start the registry:

docker run -d -p 5000:5000 --restart=always --name docker-registry -v /var/lib/docker-registry:/var/lib/registry registry:2

Start the mirror:

docker run -d -p 5555:5000 --restart=always --name docker-mirror -v /var/lib/docker-mirror:/var/lib/registry -e STORAGE_PATH=/var/lib/registry -e STANDALONE=false -e MIRROR_SOURCE=https:/ -e MIRROR_SOURCE_INDEX= registry

Start the web frontend:

docker run -d --restart=always --name docker-registry-frontend -e -e ENV_DOCKER_REGISTRY_PORT=5000 -e ENV_DOCKER_REGISTRY_USE_SSL=1 -p 80:80 konradkleine/docker-registry-frontend:v2


Edit /etc/default/docker and add DOCKER_OPTS like this:

DOCKER_OPTS=”–dns=ns1 –dns=ns2 –insecure-registry=docker-registry:5000 –registry-mirror=http://docker-registry:5555”