美文网首页
docker 配置代理

docker 配置代理

作者: _micang | 来源:发表于2024-10-29 16:22 被阅读0次
# 为docker服务创建systemd目录
mkdir -p /etc/systemd/system/docker.service.d

# 设置代理
cat > /etc/systemd/system/docker.service.d/http-proxy.conf  <<EOF
[Service]
Environment="HTTP_PROXY=http://192.168.244.232:7777"
Environment="HTTPS_PROXY=http://192.168.244.232:7777"
Environment="NO_PROXY=localhost,127.0.0.1"
EOF

# 更新配置& 重启Docker
systemctl daemon-reload && systemctl restart docker

# 确认是否已生效
[root@master-1 ~]# docker info
···
HTTP Proxy: http://192.168.244.232:7777
HTTPS Proxy: http://192.168.244.232:7777
No Proxy: localhost,127.0.0.1
Registry: https://index.docker.io/v1/
···

相关文章

网友评论

      本文标题:docker 配置代理

      本文链接:https://www.haomeiwen.com/subject/dohmdjtx.html