Illustration by Kristopher Navarro. Copyright 2018. All rights reserved.
So you want to get started with Docker on Windows. Like all your investigations, you search the web for Docker Windows. This is where you can become misled. This article uncovers the costly pitfalls when following what seems to be the ‘easy’ path to using Docker in a Windows environment.
The Easy Path Will Cost You
Let’s start with the easy path. Do a search for two words: Docker Windows. If you used Google, the first result is likely to be “Docker for Windows“. When you click on the link, you are brought to an official docker.com page. They tout that Docker for Windows “is a native Windows app deeply integrated with Hyper-V virtualization, networking and file system, making it the fastest and most reliable Docker environment for Windows.” Seems reasonable. After all, they created Docker and should know what is best for your Windows, right? You will see how these performance gains come at a financial cost while limiting the capabilities of your OS to leverage an open source VM engine.
Dose of Reality
Be prepared, however, to pay the piper by upgrading your Windows 10 Home to Windows 10 Professional. The only mention of this is a footnote at the bottom of the page: “* Requires Microsoft Windows 10 Professional or Enterprise 64-bit“. This means you’ll need the latest PC hardware and Windows OS to make use of Docker for Windows. The footnote also mentions Docker Toolbox as an option which we’ll discuss later.
Making a Deal with the Devil
What if you already have Oracle VirtualBox installed and want to get Docker working on Windows. If you choose Docker for Windows, you will get Microsoft Hyper V installed which is incompatible with VirtualBox. The simple act of installing Docker for Windows will break VirtualBox so that any Virtual Machines that you have created with it will no longer work.
Hyper V is a level 1 hypervisor that makes exclusive use of the VT-x technology. Virtualbox, HAXM, and VMware are considered level 2 hypervisors. Android developers who use VirtualBox based tools like Genymotion, or Intel HAXM to speed up the Android Virtual Device (AVD) emulator, will also be negatively affected. Hyper V just doesn’t like playing well with others in the PC sandbox.
Worse yet, if you try to back out by uninstalling Docker for Windows and re-installing VirtualBox, your system state will continue to prevent VirtualBox from working! In other words, you have made a deal with the devil and now you can’t get out of it; at least, not without removing registry entries or better yet, restoring Windows to a known working state.
Avoiding the Trap: Use Docker Toolbox
There was a time prior to the Docker for Windows application when Docker Toolbox was the only game in town. Docker Toolbox uses Oracle’s VirtualBox to create a small Linux VM with a running Docker Machine. While this adds a little overhead, the benefit is being able to run Docker containers on older Windows as well as Windows 10 Home. Included with Docker Toolbox is the Docker Quickstart Terminal which ensures that the VM and Docker Machine are started and then connects a terminal shell to your VM instance.
Docker on Windows Installation Options: In a Nutshell
|Feature||Docker Toolbox||Docker for Windows|
|OS Compatibility||Windows 7, 8, 10|
64 bit only
|Windows 10 Professional
Windows 10 Enterprise
64 bit only
|Virtual Machine (VM) Engine||Oracle VirtualBox||Microsoft Hyper V|
|VM Incompatibility||Won't work with Microsoft Hyper V||Won't work with Oracle VirtualBox|
|Performance||Additional overhead due to running Docker within Linux in a VM.||Claims less overhead because the VM is more integrated with Windows.|
Docker Toolbox will work across more types of Windows systems that exist in the wild. Many people utilize older machines and older versions of Windows in order to keep costs down. Using Docker Toolbox will empower more users to learn Docker and experience the benefits of installing entire application suites to make the best use of their equipment.