This page contains information about hosting your own registry using the open source Docker Registryopen_in_new. For information about Docker Hub, which offers a hosted registry with additional features such as teams, organizations, web hooks, automated builds, etc, see Docker Hub.
The Registry is a stateless, highly scalable server side application that stores and lets you distribute Docker images. The Registry is open-source, under the permissive Apache licenseopen_in_new. You can find the source code on GitHubopen_in_new.
You should use the Registry if you want to:
- Tightly control where your images are being stored
- Fully own your images distribution pipeline
- Integrate image storage and distribution tightly into your in-house development workflow
If you're looking for a zero maintenance, ready-to-go solution, Docker Hubopen_in_new, provides a free-to-use, hosted Registry, plus additional features (organization accounts, Automated builds, and more).
The Registry is compatible with Docker engine version 1.6.0 or later.
Start your registry:
$ docker run -d -p 5000:5000 --name registry registry:2
Pull (or build) an image from the hub:
$ docker pull ubuntu
Tag the image so that it points to your registry:
$ docker image tag ubuntu localhost:5000/myfirstimage
$ docker push localhost:5000/myfirstimage
Pull it back:
$ docker pull localhost:5000/myfirstimage
Now stop your registry and remove all data:
$ docker container stop registry && docker container rm -v registry