Created
October 26, 2016 06:56
-
-
Save mshafiee/ebca26152cb7685a5075a724f1f4209a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
HTTP proxy | |
This example overrides the default docker.service file. | |
If you are behind an HTTP proxy server, for example in corporate settings, you will need to add this configuration in the Docker systemd service file. | |
Create a systemd drop-in directory for the docker service: | |
sudo mkdir /etc/systemd/system/docker.service.d | |
Create a file called /etc/systemd/system/docker.service.d/http-proxy.conf that adds the HTTP_PROXY environment variable: | |
sudo vim /etc/systemd/system/docker.service.d/http-proxy.conf | |
[Service] | |
Environment="HTTP_PROXY=http://89.40.126.228:3128" | |
[Service] | |
Environment="HTTP_PROXY=http://proxy.example.com:80/" | |
[Service] | |
Environment="HTTP_PROXY=http://proxy.example.com:80/" "NO_PROXY=localhost,127.0.0.1,docker-registry.somecorporation.com" | |
Flush changes: | |
sudo systemctl daemon-reload | |
Verify that the configuration has been loaded: | |
$ systemctl show --property=Environment docker | |
Environment=HTTP_PROXY=http://proxy.example.com:80/ | |
Restart Docker: | |
sudo systemctl restart docker |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment