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:

  image: registry:2
  - data:/var/lib/registry
  - 5000:5000
  image: konradkleine/docker-registry-frontend:v2
  - registry
  - 8080:80

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

Gronkh ist jetzt ein Rundfunksender...

Crossfit Regionals 2018 in Berlin

Crossfit Open 2018

Qutebrowser userscript for TT-RSS

Aufbau eines Hackintosh

Enable request logging in Jetty 9.1

Hacktoberfest 2017

Automatische Erneuerung von Lets Encrypt Zertifikaten

Neue Antennen für meine Fritzbox

Fitness vs Gesundheit