Created
August 11, 2020 03:40
-
-
Save whatisor/4ea146ba89ad3af01362172e6da940f6 to your computer and use it in GitHub Desktop.
Docker proxy Need 2 Do
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
sudo mkdir -p /etc/systemd/system/docker.service.d | |
sudo nano /etc/systemd/system/docker.service.d/proxy.conf | |
[Service] | |
Environment="HTTP_PROXY=http://ip:port" | |
Environment="HTTPS_PROXY=http://ip:port/" | |
Environment="NO_PROXY="localhost,127.0.0.1,::1" | |
mkdir ~/.docker | |
nano ~/.docker/config.json | |
{ | |
"proxies": { | |
"default": { | |
"httpProxy": "http://ip:port", | |
"httpsProxy": "http://ip:port" | |
} | |
} | |
} | |
sudo mkdir /etc/docker | |
sudo nano /etc/docker/daemon.json | |
{ | |
"dns": ["ip"] | |
} | |
sudo systemctl daemon-reload | |
sudo systemctl restart docker.service | |
docker pull hello-world | |
recreate container if need |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment