當(dāng)你到要如下的Error log盈电,很可能是代理沒有設(shè)置好
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
根據(jù)你的 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