Docker – Default private registry in Docker

dockerdocker-registry

I need to set up my own private registry in Docker, to generally keep all internal Docker-images.

To make this easier, I want to have a setup internally where my Docker-images are called project/component, just like normal Docker-images you pull from https://index.docker.io/.

I am certain, that I will never grab images in this format from index.docker.io, all those images will come from our internal indexer. Even the images in the format of imagename, like centos will be pulled from our internal repository.

So, is there a way for me to change out the default indexer? Or at least change my private indexer from port 5000 to something that is tried as default; ie, to grab images from private_indexer.internal/repo_name instead of private_indexer.internal:5000/repo_name.

Is putting index.docker.io in our own dns pointing to our internal ip the best solution?

Best Answer

You can use private_indexer.internal/repo_name without any issue. Just run registry container on port 80 (you can also add some reverse proxy like nginx or hipache in front and pass traffic from port 80 to 5000). As for first part of question to change default index url you would probably need to change docker code and recompile. I tried to do this quite few versions ago and it worked but back then there was no easy to use private registry support like now. So IMHO best would be to stick with tagging all private images with private registry url. Then you will not loose access to images in public index (ubuntu, busybox).