UPDATE (Jan 15, 2019): Since writing this post, the process has become much easier. Instead of downloading the nightly binaries, set your Docker Desktop installation to use the Edge channel and then get the latest update. That update now includes the executable files to run containers in process isolation mode! I’ll leave the original post here for posterity.
Well, it looks like all of the pieces are finally coming together where we can run our Docker containers on a Windows 10 machine without the overhead of Hyper-V. Don’t get me wrong, I’ve been running my containers always on Windows 10 without much issue, but being able to not have to allocate RAM and letting the o/s handle it like it does o Windows Server is a very welcome change!
The process you are about to see involves manually replacing your Docker executables with ones from the nightly Docker build repository. If this does not sound appealing to you, I’d recommend to wait for the official Docker release that has this feature.
First off, I’m not going to pretend I’m any sort of Docker expert. I know it well enough to be ‘comfortable’, but I’m still very much a rookie in many ways (Docker networking!? Yikes…..).
One thing I do know though, is that running Docker on Windows 10 has always leveraged the built-in Hyper-V layer to manage the containers. This adds some overhead when it comes to CPU and RAM usage, and also meant that you had to specify a “maximum RAM” amount for each container you created. Running too many containers meant likely a visit from the big bad blue screen. On an 8gb machine, that often means being able to run only 1 container at a time.
On Windows Server the Hyper-V is not required (although it can be if you desire) as the containers run in what is called Process Isolation. I’m not going to get into the differences of Process vs. Hyper-V isolation (you can read about that in Freddy’s Blog here) but the thing to know is that process isolation does NOT use Hyper-V, so no extra overhead, and no need to specify any amount of allocated RAM. You can run multiple containers at a time and the operating system manages everything.
What you need to do
Here are the steps to getting your system configured for running Docker containers in process isolation on Windows 10. This process assumes that you have already installed and configured Docker on your Windows 10 machine and that it functions correctly.
If you’ve not installed Docker yet, you can grab it from here. Make sure you set Docker to use Windows Containers.
1. Apply the Windows 10 – October 2018 update
The first thing that you need to do is apply the Windows 10 update from October 2018. This will update your system to version 1809 which is required in order to run Windows containers in process isolation mode.
By the time this post is published, you should be able to get the update via Windows Update, but if not, you can manually the update using the Update Assistant here.
After the update you can use the winver command from your Start Menu to verify you are running version 1809.
2. Download Docker nightly build binaries
The ability to run Windows 10 containers without Hyper-V is not a fully baked feature in Docker yet (again, if this freaks you out, you may want to wait), so what you need to do is get the nightly build binaries that contain this feature.
These files can be downloaded from the Docker Master Binaries site. You have a load of options here as to what binaries you can get so make sure you get the correct ones.
I find the easiest file to grab is the docker.zip file. You can bookmark the link to this file and it will always get you the latest build. If you are browsing through the site though, the file I’m talking about is shown below. You can see that as of this post the file is dated December 20, 2018 but that will likely change by the time you download the file.
Once you have the file downloaded, extract it and you will see 2 files inside:
3. Replace Docker binaries
We need to replace the Docker binaries that are currently installed with the new ones that we downloaded in step 2. The first thing we need to do is stop Docker. Do that by right-clicking on the Docker whale icon in your system tray and choose Quit Docker Desktop.
Once Docker has stopped we can replace the existing files. You will find them at the following locations:
Before replacing any files make sure to backup the original ones!!!
One thing to note is that after doing this a few times, once in a while stopping Docker was not enough. I also had to also go into Computer Management and stop the Docker services. Just right-click on each service and select Stop.
4. Reboot your system
Yes you can probably just restart everything that you stopped in step 3, but I like to do a full reboot so that I can make sure everything starts up as it normally would.
5. Turn off Docker update checks [OPTIONAL]
This step is not required, but you may or may not want to do it depending on how tempted you are to click on the install button the next time Docker prompts you that an update is available. Remember we’re using an unreleased set of binaries now so before taking any update, make sure that it’s not going to revert you to a version that still requires Hyper-V. If you want to turn off those prompts you can do so in the Docker Desktop Settings.
If you are using NavContainerHelper to do all of your Dynamics NAV and Business Central container management then make sure to update to the latest version so that when you pull images and create containers, you will be pulling the ltsc2019 images, which Freddy explains all about here.
At this point your system is ready to run Windows containers without Hyper-V. If you have any containers that you had created before doing the above updates, they will continue to use Hyper-V. You’ll probably want to recreate those containers using the new ltsc2019 images and if you do, you will then want to clean up your old containers and images. Once again, I can defer to Freddy on how to do this.
That’s it! Until next time, happy coding…and Dockering!?