当你到要如下的Error log,很可能是代理没有设置好
Error response from daemon: Get https://registry-1.docker.io/v2/: dial tcp: lookup registry-1.docker.io on xx.xx.xx.xx:53: no such host
用 Ubuntu 16.04 举例子
编辑下面的文件
/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="HTTP_PROXY=http://xx.xx.xx.xx:xxxxxx"
Environment="HTTPS_PROXY=http://xx.xx.xx.xx:xxxxxx"
ExecStart=/usr/bin/dockerd -H fd:// --storage-driver=aufs
根据你的 Proxy 配置,如下变量
Environment="HTTP_PROXY=http://xx.xx.xx.xx:xxxxxx"
Environment="HTTPS_PROXY=http://xx.xx.xx.xx:xxxxxx"
做完后,重新启动docker
- systemctl daemon-reload
- systemctl restart docker