Getting Started with Docker
Yes, a blog about NAV/BC on Docker! “Docker” seems to be battling “VS Code” for the blockchain-status of the NAV/Business Central world. Everybody seems to be talking about it. I’ve been using it for about a year now, and rest assured, I’ve struggled. Multiple times. Often enough to share what I’ve learned.
The mere fact that you’re reading this probably means you either want to know if Docker is for you, or you want to know where to begin. Please don’t expect a full length step-by-step manual of everything there is to know about Docker; A lot has already been written by people who know much more about Docker than I do. I do intend to get you to the right information and add what’s missing in my opinion.
So let’s start with some important blog links:
Freddy Kristiansen – this guy is the heart of NAV on Docker at Microsoft. Has written so much about the subject that it’s sometimes difficult to find the right blog 😉
Tobias Fenster – CTO at Axians Infoma, but seems to have fallen in love with Docker. In my opinion he knows just about everything there is to know about Docker, if you have a chance to visit one of his sessions, it’s worth it.
David Markus’ revelations about Docker – Cloud Architect at X-Talent, but also a Docker nerd. This link is not really a blog, but a presentation about Docker that’ll give you a clear overview of what Docker is and how it works, and will do so fast thanks to some neat navigation.
Do you need Docker?
Docker makes it possible to set up an isolated container with Business Central or NAV ready to go within minutes. The limiting factor is literally your internet connection, and you can run as much different versions alongside each other as you want.
If you regularly work on multiple NAV/Business Central on Premise databases, maybe even with different versions, and outside of a live environment, then yes, you do.
I run Docker for:
- Development and automated testing of Business Central extensions, both for AppSource and on Premise environments;
- Development of customizations for customers (I have a Cronus on the right version, extensions and localization for every customer);
- Testing of functionality in different versions of NAV/BC
Docker can be used for much more than this, for example running various applications on live servers; I’m only focusing on NAV/BC consulting here.
Which version do I need?
Most “getting started with Docker” blogs will refer you to www.docker.com and tell you to download and install Docker. If you follow this advice, you end up here:
So which version do you need?!
If you already know what you’re installing on, it’s actually quite simple:
- If you run Windows 10, choose Docker Desktop. You can click the link to download and install Docker on your system.
- If you intend to run Docker off a Windows Server, you want Docker Enterprise. This cannot be installed from here, an install manual will appear here soon.
Do you have a choice?
Then the version you should get depends on what you want to do. Oversimplified, it’s like this:
- Are you planning to run Docker for you personally? For example on a laptop? Then choose Windows 10 and get Docker Desktop. It’s free, and can do most of the stuff the enterprise version can too.
- Do you want to share your development environment with other developers? Are you looking for a cloud-like experience when connecting to your NAV/BC? Do you have powerful hardware (6+ cores, 24GB+ RAM)? Then Docker Enterprise might be for you. In my experience, it’s more stable and scales better. The biggest disadvantage would be the higher cost.
What advantages does Docker have over running VMs?
Let’s imagine you’re running a laptop with a modern six core processor and 16GB of RAM. For Dynamics NAV 2018 or Business Central on premise development, you will need a stable and fast Windows 10 environment with Visual Studio Code, a browser, some Office programs etcetera. Okay, I sometimes also use finsql (with UI) and SQL Server Management Studio – some people call me old-fashioned 😉 For all this software you’ll need at least 8GB of RAM to run comfortable.
Then we’ll create one VM running the most recent Business Central on premise; you’ll need to install Windows 10 (or download a 12GB Windows image), probably you’ll want to run some updates, maybe install SQL Server, install Business Central (maybe including the demo database and SQL Server Express), setup the servicetier, configure the firewall to allow traffic into your machine and I’m probably forgetting a lot here.
How long will all this take? an hour at least. You’ll probably also want at least one dedicated core assigned to this machine, and at least 4GB of RAM to have something vaguely resembling “performance” out of this NAV setup.
Now let’s add customers on 4 different versions to the mix; you’ll either:
- Need to create multiple VMs (in which case I’m hoping you made a copy of that freshly installed and updated Windows 10 VM earlier, before setting up NAV…), or;
- Have to fiddle with your running installs to install a second version alongside the first one, at the risk of ending up with nothing working at all.
Let’s compare this to a Docker install: Admittedly, both Docker Desktop and Docker Enterprise took me a fair share of time to get going, but once you dó have it running, setting up a new development environment will take you one command and less than five minutes of waiting. Which is awesome!
Another gain of using Docker is the fact that it’s a lot less resource hungry than a VM. It is not only possible to run a fully functional developer’s Windows environment with 4 simultaneously running containers, it will return more than reasonable performance. If you’re a raw numbers person, David Markus did a test for his revelations on Docker presentation. The results:
Doesn’t it have any disadvantages?
Well, yes it does. Sometimes, Docker is just a bit of a motherDocker. Google is not always your friend here either; Googling Docker issues will also give you a lot of solutions that apply only to Linux containers and/or Docker running on Linux, and solutions for problems that work only on *insert older, newer or different version of Windows*.
You will probably learn a good bit about networking, but it’s well worth it. And concerning Google, I hope this blog series will be part of the solution.
Let’s get this party started!