Docker Engine VS Docker Desktop
When you start developing on your local Windows machine for (e.g. Microsoft Dynamics 365 Business Central), you will eventually encounter the topic of containerization with Docker. Probably the easiest and most common way among developers is to use Docker Desktop. It’s also recommended by Docker1. With the update of the Docker Desktop License Agreement2 (effective date of these terms is August 31, 2021) you might consider using standalone Docker (Docker Engine) instead of Docker Desktop.
Commercial use of Docker Desktop at a company of more than 250 employees OR more than $10 million in annual revenue requires a paid subscription (Pro, Team, or Business).3
Windows containers
To install the Docker Engine, I use the script that is provided by the microsoft/nav-arm-templates repository on GitHub. It installs and updates Docker on your local windows machine and is mentioned on the Install Docker Engine4 step in the README.md
of the navcontainerhelper repository on GitHub.
Invoke-WebRequest -UseBasicParsing -uri 'https://raw.githubusercontent.com/microsoft/nav-arm-templates/master/InstallOrUpdateDockerEngine.ps1' -OutFile (Join-Path $ENV:TEMP 'installorUpdateDocker.ps1')
. (Join-Path $ENV:TEMP 'installorUpdateDocker.ps1')
The installorUpdateDocker script will take care over numerous steps for you:
- check if docker desktop is already installed
- install windows feature containers
- get latest stable version and URL
- check existing docker version
- download new version
- register service if necessary
- start the service
Execute the InstallOrUpdateDockerEngine.ps1 for the first time:
Execute the InstallOrUpdateDockerEngine.ps1 for the second time:
Docker Engine: Pros and Cons
Docker has an official comparison: Docker Desktop vs DIY with Docker Engine
Here are some of my own thoughts:
Pros
- It’s free to use (see LICENSE5)
- Production servers running docker engine, so it’s a good habit to familiarize yourself with docker commands
- If you only use the Docker commands, a GUI might be too much anyway
Cons
- You do not get ready-to-use Linux and Windows containers, as would be the case with Docker Desktop
- You need to update the Docker Engine manually
Linux containers
- 1. Install WSL (version 2)
wsl --install
(by default, the installed Linux distribution will be Ubuntu. This can be changed by using the
-d
flag)- 1.1. Ubuntu has been installed. Changes will not be effective until the system is rebooted
- 1.2. After reboot, a prompt will show up to setup Ubuntu (add a user)
- 2. Open Install Docker Engine of the Linux distribution you have chosen (we use Ubuntu)
- 3. Choose an Installation Method
-
3.1. Set up Docker’s apt repository
# Add Docker's official GPG key: sudo apt-get update sudo apt-get install ca-certificates curl sudo install -m 0755 -d /etc/apt/keyrings sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc sudo chmod a+r /etc/apt/keyrings/docker.asc # Add the repository to Apt sources: echo \ "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \ $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \ sudo tee /etc/apt/sources.list.d/docker.list > /dev/null sudo apt-get update
-
3.2. Install the Docker packages
sudo apt-get install docker-ce docker-ce-cli containerd.io
-
Conclusion
Regardless of whether you use Docker Desktop or Docker Engine, you will end up creating Docker containers on your local machine. For Business Central development, we typically use scripts from the BcContainerHelper PowerShell module, so we don’t miss the missing GUI too much. When managing multiple containers, a container management platform with a user interface can be particularly useful. In this case, Portainer is a great option, offering a web interface that makes it also accessible from other devices.
See you around 🦦