Running a local Docker registry


When you’re using Docker extensively, you sometimes need to run your own registry in order to push images around in your local network - or even on your local machine. For that you need a registry where you can push and pull images. With Docker itself, it’s easy to set it up. Here is a small docker-compose.yml which runs a registry and a simple frontend:

registry:
  image: registry:2
  volumes:
  - data:/var/lib/registry
  ports:
  - 5000:5000
frontend:
  image: konradkleine/docker-registry-frontend:v2
  links:
  - registry
  ports:
  - 8080:80
  environment:
  - ENV_DOCKER_REGISTRY_HOST=registry
  - ENV_DOCKER_REGISTRY_PORT=5000

The registry is persisting its data into the directory data, so nothing is lost if you throw away and recreate the container.

Save the file as docker-compose.yml and start it via docker-compose up in the same directory. After that you can open http://localhost:8080 and you see a basic frontend (taken from kwk/docker-registry-frontend).

Docker Registry with Frontend

Now when you push an image to your registry with the following command it becomes visible on the frontend:

docker pull alpine && docker tag alpine localhost:5000/alpine
docker push localhost:5000/alpine

Refresh the registry frontend and you’ll see the new image is available. You can now pull it with the following command:

docker pull localhost:5000/alpine

Have fun!

Weitere Artikel

Der letzte PR

Fahrrad geklaut

Erstes Review des Sony XZ Premium

Unterschiedliche Sichtweisen

Vorbestellt: Sony Xperia XZ Premium

Giants Run 2017

Gelesen: SciFi Serie 'The Expanse'

Neue Tastatur: Pok3r Vortex RGB

New minecraft survival mod for 1.11.2

Änderungen beim Flug mit Quadkoptern