Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How does mirror registry work in docker?

I want to deploy the registry mirror in docker, and it can avoid a trip out to the internet to refetch it. So, I use command:

docker pull ubuntu
docker rmi ubuntu

I guess that there is ubuntu image in my local.So, I closed my Internet, then use command:

docker pull ubuntu

But,it didn't work. I don't know what happened. I want to know how mirror work. May it need to connect docker hub to get dependence? or May I fail to deploy the mirror?

By the way, how to know whether I succeed in deploying mirror?

like image 755
v11 Avatar asked Oct 18 '25 07:10

v11


1 Answers

You need to make sure your docker daemon was started with docker --registry-mirror=http://<my-docker-mirror-host> -d, or none of the docker pull call would go through your mirror.

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

The OP v11 confirms in the comments:

I think I fail to start mirror. Thanks! it maybe I don't started with docker --registry-mirror=http:// -d

The OP did modify the /var/lib/boot2docker/profile as advised here, but might not have restart boot2docker before the mirror tests.

like image 92
VonC Avatar answered Oct 20 '25 08:10

VonC



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!