docker使用代理pull

05
Jun

docker使用代理pull

因为设备无法直接连接到互联网,希望通过http代理的通道pull镜像

sudo mkdir -p /etc/systemd/system/docker.service.d
sudo touch /etc/systemd/system/docker.service.d/proxy.conf

sudo vim /etc/systemd/system/docker.service.d/proxy.conf

[Service]
Environment="HTTP_PROXY=http://127.0.0.1:7890/"
Environment="HTTPS_PROXY=http://127.0.0.1:7890/"
Environment="NO_PROXY=localhost,127.0.0.1,192.168.*.*"

sudo systemctl daemon-reload
sudo systemctl restart docker

添加新评论