Skip to content

Instantly share code, notes, and snippets.

@whatisor
Created August 11, 2020 03:40
Show Gist options
  • Save whatisor/4ea146ba89ad3af01362172e6da940f6 to your computer and use it in GitHub Desktop.
Save whatisor/4ea146ba89ad3af01362172e6da940f6 to your computer and use it in GitHub Desktop.
Docker proxy Need 2 Do
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