15.04版本后,Ubuntu是基于systemd,在/etc/default/docker中设置代理已经无效了。具体的方法是:
1. mkdir /etc/systemd/system/docker.service.d
2. vi /etc/systemd/system/docker.service.d/http-proxy.conf
3. 在文档中插入:
[Service]
Environment="HTTP_PROXY=http://proxy.example.com:80/"
4. sudo systemctl daemon-reload
5. sudo systemctl restart docker