How does mirrored registry work in docker?

I want to deploy a mirror of the registry in docker and it can avoid going to the internet to restore it. So, I use the command:

docker pull ubuntu
docker rmi ubuntu

      

I assume there is a ubuntu image in my local.So, I shut down my internet and then use the command:

docker pull ubuntu

      

But it didn't work. I don't know what happened. I want to know how the mirror works. Maybe you need to connect a docker hub to get the dependency? Or can I not unfold the mirror?

By the way, how do I know if I can unfold the mirror?

+3


source to share


1 answer


You need to make sure your docker daemon is started with docker --registry-mirror=http://<my-docker-mirror-host> -d

, or none of the calls docker pull

will go through your mirror.

And of course, make sure there is one running mirrored registry container ( docker ps -a

)

OP v11 confirms in the comments :



I think I cannot start the mirror. Thank you! maybe i don't start with docker -registry-mirror = http: // - d

OP did change /var/lib/boot2docker/profile

as mentioned here , but boot2docker may not reboot before mirroring testing.

+1


source







All Articles