At present, Docker pull in China cannot be used normally, and several commonly used domestic mirror sites have stopped service. If there is no available proxy, I don’t know how to access it. . .
However, for friends who have a proxy, you can use the following method to solve the problem that docker pull cannot pull the image:
mkdir -p /etc/systemd/system/docker.service.d vim /etc/systemd/system/docker.service.d/proxy.conf
Use vim to add the following content to the newly created proxy.conf and save it. Assume that 100.100.100.100 is your proxy server address and 58880 is the proxy server port:
[Service] Environment="HTTP_PROXY=http://100.100.100.100:58880/" Environment="HTTPS_PROXY=http://100.100.100.100:58880/" Environment="NO_PROXY=localhost,127.0.0.1"
Then restart the systemd and docker services:
systemctl daemon-reload systemctl restart docker
At this time, use the following command to view:
systemctl show --property=Environment docker
You can see that the docker environment has used the proxy we configured, and then perform docker pull:
It can be used normally now.
Another: It is a bit strange that usingproxychains docker pull
The method does not work properly. It is clearly pointing to a proxy. This makes me a little confused. In the past, when the pull was slow, I used proxychains directly. . . I'll leave a mark here and study it when I'm in the mood.
I built a mirror locally using the registry, and then configured the mirror with a proxy to access dockerhub. If you build or pull images frequently, you can also use the cache.
It is also possible. I don't pull images very often now, I just use them occasionally, so there is no need to bother with it. Now because of the cache, if I don't log in directly to the local backend of WordPress, I can't see the comments. I feel that it is very strange that no one has commented during this period. Today, I directly logged in to the local backend and found a lot of comments.
Thank you, I'm a novice who just came into contact with docker, so you gave me a big
You're welcome. As long as it's useful, that's good. However, this method has its own threshold and requires scientific ability.
proxychains docker pull
It is normal that it cannot be used.1 TP4Tbddocker pull
This action is actually performed by dockerd started by systemd, and docker itself only sends the pull command to dockerd. It is meaningless to proxy the docker controller. You have to find a way to proxy the dockerd that actually performs the operation. Dockerd has already been running by systemd before you execute the docker pull command. At this time, it is not only too late to use proxychains, but also the object that really needs to be proxied is wrong.Thanks for the answer, which saved me the time of studying again. It seems that I am still too rough about the details of the internal workings of Docker, and only stay at the level of basic usage. I will study it in depth in the future.
That's awesome, bro.
This is not great, there are tutorials everywhere on the Internet~~Many of my other articles are great. .
On-premises direct gateway proxy.
This is written for scenarios (or people) where there is no gateway proxy but only a general proxy, such as a cloud server. Of course, it is not needed locally, and I don’t feel it.