Installing Docker toolbox on Windows 7
Where I work we are still on Windows 7 development machines which means we can’t use Docker for Windows - Windows 10 is required. Luckily there is Docker Toolbox, the “Legacy desktop solution” for systems that don’t meet the minimum requirements. Here a small Linux VM is spun up which will host Docker. I spent a couple days getting it set up and configuring it to work in my company. This post details the steps and workarounds I took.
Installing Docker Toolbox
The Docker Toolbox on Windows page provides the download link and installation instructions. The pre-requisites are:
- Your machine must have a 64-bit operating system running Windows 7 or higher
- Virtualization must be enabled on your machine (BIOS setting; I had to get my helpdesk to do this since my PC is not located anywhere near my desk)
Once installed, you fire up the Docker Quickstart Terminal.
Boom!
Getting the Boot2Docker ISO image
I think the issue is that the quickstart terminal doesn’t have access through the corporate firewall so is unable to locate the ISO. A forum post gives a workaround:
- Download the latest boot2docker image from https://github.com/boot2docker/boot2docker/releases (v18.01.0-ce for me)
- Save it to the Docker local cache in
c:\user\USERNAME.docker\machine\cache
Success!
VM proxy settings
Next up, run the hello world sample:
Oh dear! It’s the proxy server again. But this time its the new boot2docker VM that can’t get through. Google to the rescue!
- https://stackoverflow.com/questions/24489265/docker-boot2docker-set-http-https-proxies-for-docker-on-os-x
- https://docs.docker.com/toolbox/faqs/troubleshoot/#configure-http-proxy-settings-on-docker-machines
I chose the option of editing the config within the VM, rather than supplying parameters. YMMV. What I did:
docker-machine ssh
to get a terminal session in the VMsudo vi /var/lib/boot2docker/profile
to edit the profile settings with write access- Add settings for
HTTP_PROXY
andHTTPS_PROXY
:export HTTP_PROXY=user:password@your.proxy.name:8080
sudo /etc/init.d/docker restart
to restart the VM docker service and pick up the new settingsexit
to leave the VM terminal session
Try again:
Docker quickstart terminal environment variables
After much googling I came across the solution: the docker terminal didn’t have the correct environment variables set. See the Docker toolbox troubleshooting page for details.
Reset them with $ eval $("C:\Program Files\Docker Toolbox\docker-machine.exe" env)
, then try again.
Bingo! We now have a working Docker toolbox!
docker (9)