Docker无法拉取镜像的解决办法

0x01 设置镜像代理地址

修改镜像地址

sudo tee /etc/docker/daemon.json <<EOF
{
  "registry-mirrors": [
    "https://docker.opkg.us.kg"
  ]
}
EOF

重启守护进程

# 使配置生效
systemctl daemon-reload
# 重启Docker
systemctl restart docker

0x02 设置临时端口代理

安装软件

sudo apt install proxychains4

修改配置

sudo nano /etc/proxychains.conf

将最后一行的地址修改为你自己的

使用代理

proxychains yourcommand

0x03 附录:其他的代理

Last modification:November 28, 2024
If you think my article is useful to you, please feel free to appreciate