Start the Docker Quickstart Terminal and follow this steps ($ ==> terminal prompt):
$ docker-machine start default
$ eval $(docker-machine env default )
ssh into the machine named 'default' and update docker VM's /var/lib/boot2docker/profile
$ docker-machine ssh default
docker@default:~$ sudo vi /var/lib/boot2docker/profile
Add below line in end of file:
(replace with your office's proxy environment)
export "HTTP_PROXY=http://PROXY:PORT"
export "HTTPS_PROXY=http://PROXY:PORT"
# you can add more no_proxy with your environment.
export "NO_PROXY=192.168.99.*,*.local,169.254/16,*.example.com,192.168.59.*"
restart / exit docker daemon
docker@default:~$ sudo /etc/init.d/docker restart
docker@default:~$ exit
$ docker search ubuntu
Now you should be fine to pull and push images. Kitematic works as well.
If you are back to home, just remove/comment proxy settings in /var/lib/boot2docker/profile and restart the docker daemon.
All done and enjoy with it.
And also since version 1.8, docker-machine now supports the configuration of the proxies at VM creation time via an invocation like the following:
$ docker-machine create -d virtualbox \
--engine-env HTTP_PROXY=http://user:password@proxyhost:port \
--engine-env HTTPS_PROXY=http://192.37.246.181:2010 \
--engine-env NO_PROXY=*.localhost \
machinename
Source OPTION I: docke/toolbox issue #102 (how to set proxy in docker toolbox?)
Source OPTION II: stackoverflow.com - Docker/Boot2Docker: set proxy