Skip to content

Instantly share code, notes, and snippets.

@tonfever
Created April 20, 2017 08:53
Show Gist options
  • Save tonfever/9c2076f1260d028daf38aec06150dabb to your computer and use it in GitHub Desktop.
Save tonfever/9c2076f1260d028daf38aec06150dabb to your computer and use it in GitHub Desktop.
How to set a proxy setting for Docker in Windows (Docker toolbox)
This is how to set up the proxy for docker in Window 7 (Docker Toolbox). This window7 cannot install the latest version of docker.
Newer version of docker setting may vary. And the problem is after docker installation and you want run the first docker.
You would run "docker run hello-world". Then you got the error that you're unable to find image locally XXXX. And you found that causes
from Docker cannot access the internet to get an image. That is we have to set a proxy for Docker. Here's a step
1. Go to the config.json in the folder /$USER_HOME/.docker/machine/machines/$YOUR_MACHINE
2. Add the proxy setting in the 'Env' section as following
"HostOptions": {
.......
"EngineOptions": {
.........
"Env": [
"HTTP_PROXY=[USERNAME]:[URL_ENCODED_PASSWORD]@[PROXYSERVER]:[PORT]",
"HTTPS_PROXY=[USERNAME]:[URL_ENCODED_PASSWORD]@[PROXYSERVER]:[PORT]",
],
After that, re-run provisioning
$docker-machine provision
Try run again, that would be working.
$docker run hello-world
Hope that is useful. Enjoy!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment