Skip to content

Instantly share code, notes, and snippets.

@owainlewis
Created March 24, 2017 10:29
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 5 You must be signed in to fork a gist
  • Save owainlewis/8c93f49e1fd269ddc4aecccfba2f3e2a to your computer and use it in GitHub Desktop.
Save owainlewis/8c93f49e1fd269ddc4aecccfba2f3e2a to your computer and use it in GitHub Desktop.
Set docker proxy on Ubuntu 16.04

How to setup docker behing a HTTP proxy

mkdir /etc/systemd/system/docker.service.d

sudo touch /etc/systemd/system/docker.service.d/http-proxy.conf

Add proxy info

[Service]
Environment="HTTP_PROXY=http://emea-proxy.uk.oracle.com:80"
Environment="HTTPS_PROXY=http://emea-proxy.uk.oracle.com:80"

Restart and flush

sudo sysetmctl daemon-reload
sudo systemctl restart docker
@JerryCui
Copy link

Hi Owain
I used your method with my proxy server: http://127.0.0.1:1080, it didn't work.
Could give me any suggestions?
Thanks.

@jgsuess
Copy link

jgsuess commented Oct 30, 2019

typo: systemctl daemon-reload

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment