1、注意Docker版本(此处版本为docker-ce-18.06.1)

docker version

2、编辑Docker服务配置文件

vim /usr/lib/systemd/system/docker.service
......
[Service]
Type=notify
# the default is not to use systemd for cgroups because the delegate issues still
# exists and systemd currently does not support the cgroup feature set required
# for containers run by docker
Environment="HTTPS_PROXY=http://172.16.16.100:1080"
Environment="NO_PROXY=127.0.0.0/8,172.16.16.0/21"
ExecStart=/usr/bin/dockerd
ExecReload=/bin/kill -s HUP $MAINPID
......

3、重启Docker服务

systemctl daemon-reload
systemctl restart docker

4、验证代理设置

docker info

参考:https://docs.docker.com/config/daemon/systemd/

相关文章:

  • 2022-12-23
  • 2021-06-10
  • 2021-06-18
  • 2022-12-23
  • 2022-01-05
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-08-21
  • 2021-10-13
  • 2021-09-27
相关资源
相似解决方案