[Ubuntu 16.04]
此版已用systemd來管理服務,所以必須經由以下設定來走http proxy
- sudo mkdir -p /etc/systemd/system/docker.service.d
- sudo vim /etc/systemd/system/docker.service.d/http-proxy.conf
- edit your http proxy config file
[Service]
Environment="HTTP_PROXY=http://proxy.example.com:80/" "NO_PROXY=localhost,127.0.0.1,docker-registry.somecorporation.com"
4. sudo system daemon-reload
5. sudo systemctl restart docker
5. sudo systemctl restart docker
[Ubuntu 14.04]
- sudo vim /etc/default/docker # edit your docker runtime context file
DOCKER_OPTS="--log-opt max-size=500m --insecure-registry {docker-registry} --dns 8.8.8.8"
export http_proxy="http://{http-proxy}:8080"
export https_proxy="https://{http-proxy}:8080"
export no_proxy="localhost,127.0.0.1"
[Refer]
沒有留言:
張貼留言