Currently, domestic docker pull can no longer be used normally, and several commonly used domestic mirror sites have stopped their services. If there is no available proxy, I wouldn't even know how to access them...

However, for users who have a proxy, you can use the following method to solve the issue of docker pull being unable to pull images:
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, assuming 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 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 is already using the proxy we configured, and then perform docker pull:

It can now be used normally.
Also: it's a bit strange that usingproxychains docker pullthis way actually doesn't work normally either, even though they both point to the same proxy. This got me a bit confused, as I used to just use proxychains directly when pulling was slow... I'll leave a note here and look into it when I'm in the mood.
Because the docker command sends instructions to dockerd, and px only proxied docker but not dockerd, so naturally it had no effect
Yes, I know now, but I didn't know back then~.
I built a mirror locally using registry, and then configured a proxy for the mirror to access Docker Hub. If you build or pull images frequently, you can even use the cache.
That works too. I don't pull images very often now, just occasionally, so I don't need to go through all that trouble. Now, because of caching, if I don't log directly into the WordPress local backend, I can't even see the comments~~. I felt it was so strange lately that no one was commenting, but today I logged directly into the local backend and found a bunch of them.
Thanks a lot! As a complete newbie who just started with Docker, this was a big one for me.
You're welcome, glad it's useful. However, this method has a threshold; you need to have the ability to bypass the firewall yourself.
proxychains docker pullIt's normal that it doesn't work. Becausedocker pullthis action is actually executed by dockerd started by systemd, while docker itself just sends the pull command to dockerd. Proxying docker, the controller, is completely meaningless; you have to find a way to proxy dockerd, which actually performs the operation. And dockerd was already run by systemd long before you executed the docker pull command. Going to proxychains at this point is not only too late, but also targets the wrong object that needs to be proxied.Thanks for the explanation, bro, saved me the time of researching it myself. It seems my understanding of Docker's internal workings is still too superficial, just staying at the basic usage level. I will study it in more depth and detail in the future.
Awesome, buddy!
This isn't that awesome, there are tutorials everywhere on the internet~~ Many of my other articles are the ones that are actually awesome...
Local direct gateway proxy.
This is written for scenarios (or people) where there is no gateway proxy but only a general proxy, such as cloud servers~. Of course, it's not needed locally, I didn't even notice.