setting up local docker registry
Normally i thought this is going to be difficult process. But turns out to be easy as,
docker run -d -p 5000:5000 --restart=always --name registry registry:2
From this point onward, your registry is already setup. So it is just working with docker images by pulling, tagging and pushing it.
docker tag ubuntu:16.04 localhost:5000/my-ubuntu
the only part you have to get it right is tagging with localhost:5000/
docker push localhost:5000/my-ubuntu
That's it, we're done. (your can try to browse your docker repo with a browser example, :- http://localhost:5000/v2/_catalog)
Testing it out
Remove all our local images
$ docker image remove ubuntu:16.04
$ docker image remove localhost:5000/my-ubuntu
Lets try pulling it from our registry.
docker pull localhost:5000/my-ubuntu
That's ways easy.
Comments