Configure proxy to solve the issue of docker pull command being unable to pull images
This article was last updated 287 days ago. The information within may have evolved or changed; if anything is outdated or broken, please feel free to leave a message in the comments section.
Article Abstract
To address the issue of the pull command failing due to the interruption of domestic Docker mirror source services, a solution can be implemented by configuring a proxy server. Specific operations include setting the proxy address and port in the proxy.conf file, and then restarting systemd and the Docker service to make the configuration take effect. Tests show that this method can successfully restore the image pulling function, but experiments found that there are still anomalies when using the proxychains tool to connect to the same proxy address. This phenomenon may be related to proxy protocol or tool compatibility and requires further verification. This solution is suitable for user scenarios where overseas mirror sources need to be accessed through a proxy.
Qwen3-14B · 2026-06-18

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...

image.png

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

image.png

You can see that the docker environment is already using the proxy we configured, and then perform docker pull:

image.png

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.

View Related Categories · 3 Matches
📌 Content Structure Prompt:
This content is part of the following knowledge map, where you can view the complete content path: Blog Knowledge Map。
📎 Related Articles
Share this article
The blog content is original, please indicate the source when reposting! The RSS address of the blog is:https://blog.tangwudi.com/feed, welcome to subscribe; if needed, you can join theTelegram Groupto discuss questions together.

Comments

  1. upup
    Windows Chrome 133.0.0.0
    2 years ago
    2025-2-06 14:24:11

    Because the docker command sends instructions to dockerd, and px only proxied docker but not dockerd, so naturally it had no effect

    • Owner
      upup
      Macintosh Chrome 132.0.0.0
      2 years ago
      2025-2-06 15:50:30

      Yes, I know now, but I didn't know back then~.

  2. wbuntu
    Macintosh Chrome 127.0.0.0
    2 years ago
    2024-8-13 23:53:23

    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.

    • Owner
      wbuntu
      Macintosh Chrome 127.0.0.0
      2 years ago
      2024-8-15 10:14:47

      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.

  3. 111
    Linux Edge 127.0.0.0
    2 years ago
    2024-8-12 21:03:30

    Thanks a lot! As a complete newbie who just started with Docker, this was a big one for me.

    • Owner
      111
      Macintosh Chrome 127.0.0.0
      2 years ago
      2024-8-15 10:15:23

      You're welcome, glad it's useful. However, this method has a threshold; you need to have the ability to bypass the firewall yourself.

  4. Ice in the Bamboo Forest
    Linux Firefox 128.0
    2 years ago
    2024-6-30 4:37:27

    proxychains docker pull It's normal that it doesn't work. Because docker pull this 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.

    • Owner
      Ice in the Bamboo Forest
      Macintosh Chrome 126.0.0.0
      2 years ago
      2024-6-30 10:10:10

      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.

  5. jjxx
    Windows Edge 125.0.0.0
    2 years ago
    2024-6-13 15:43:57

    Awesome, buddy!

    • Owner
      jjxx
      Macintosh Chrome 125.0.0.0
      2 years ago
      2024-6-13 15:46:34

      This isn't that awesome, there are tutorials everywhere on the internet~~ Many of my other articles are the ones that are actually awesome...

  6. Windows Edge 125.0.0.0
    2 years ago
    2024-6-10 10:31:02

    Local direct gateway proxy.

    • Owner
      Netizen Xiao Song
      Macintosh Chrome 125.0.0.0
      2 years ago
      2024-6-10 10:40:41

      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.

Send Comment Edit Comment


				
|´・ω・)ノ
ヾ(≧∇≦*)ゝ
(☆ω☆)
(╯‵□′)╯︵┴─┴
 ̄﹃ ̄
(/ω\)
∠( ᐛ 」∠)_
(๑•̀ㅁ•́ฅ)
→_→
୧(๑•̀⌄•́๑)૭
٩(ˊᗜˋ*)و
(ノ°ο°)ノ
(´இ皿இ`)
⌇●﹏●⌇
(ฅ´ω`ฅ)
(╯°A°)╯︵○○○
φ( ̄∇ ̄o)
ヾ(´・ ・`。)ノ"
( ง ᵒ̌皿ᵒ̌)ง⁼³₌₃
(ó﹏ò。)
Σ(っ °Д °;)っ
( ,,´・ω・)ノ"(´っω・`。)
╮(╯▽╰)╭
o(*////▽////*)q
>﹏<
( ๑´•ω•) "(ㆆᴗ
😂
😀
😅
😊
🙂
🙃
😌
😍
😘
😜
😝
😏
😒
🙄
😳
😡
😔
😫
😱
😭
💩
👻
🙌
🖕
👍
👫
👬
👭
🌚
🌝
🙈
💊
😶
🙏
🍦
🍉
😣
Source: github.com/k4yt3x/flowerhd
Kaomoji
Emoji
Little Dinosaur
Flower!
Previous
Next
       

👋 Welcome to “Wudi's Personal Blog”

Here, long-term exploration is mainly carried out around the following directions:

🧱 Personal Digital Infrastructure and Blog System Construction
☁️ Cloudflare and Network Architecture Practice
🧠 AI and Knowledge System Exploration
🛡️ Network Security and Access Optimization
🎵 Music and Sound Cognition
👁️ Cognitive Perspectives and Worldviews