Well – I guess there is no way around – Docker is the way forward, and you’d better get on the train!
Well, I am not going to tell you what Docker is. I am BY FAR not an infrastructural guy – so I wouldn’t feel comfortable. No, there are already quite some people out there, that are blogging quite a lot about this topic. Let me start by giving you a few references which i think are invaluable:
- Freddy Kristiansen’s blog: Freddy started a series of (almost daily) blogs about the topic to get you started. All are interesting! And all are necessary to get started! Use the link, and work you way bottom-up!
- Tobias Fenster: together with Jakub Vañák (I didn’t find his blog – if he has any ;-)), Tobias co-started the Docker initiative with Freddy .. and it’s mainly thanks to these three people that we are where we are, and we have what we have! Big thanks from me as well! :-).
Purpose of this blog(serie)
I like the initiative a lot. Not because it makes quite a number of my PowerShell scripts completely obsolete and unnecessary (it really does) .. but mainly because for the NAV world, this just makes a lot of sense. And even more – installing NAV with my PowerShell scripts would take about 20 minutes, while with Docker, it’s far less time it needs! You set up an environment in just a few minutes – even seconds, if the image is already downloaded!
Just think of these scenarios:
- A build server, where you are able to automate builds, testing the builds .. on any recent version/localization of the application.
- A partner, who needs quite a number of environments, versions, .. alongside each other.
- A way to have a local dev environment, and update it very easily without having to uninstall/install anything.
I’m sure you have your own usecases – and I haven’t implemented any of these scenarios (let alone I’m sure it’s feasable with Docker or not – but I think so .. ;-)).
The purpose of this blogpost (and possible follow-ups in the future) is simply to share my personal experience, as a simple guy, that’s trying to find his way in implementing Docker for himself, and his company ;-).
Just a few facts
Let me share a few things that I think are necessary to know before you get started. It’s basically all in the blogs above, but let me share anyway:
- Navcontainerhelper: a PowerShell Module by Freddy that helps you to work with NAV and Docker on your system. Very easy to install, and very easy to use! Install it from the PowerShell Gallery, and use “Write-NavContainerHelperWelcomeText” to get you going!
- NAV Images: You can find all the NAV images on a public repository called “Docker hub“. There, you will find a repo for the “Dynamics NAV” images. The page explains all you need to know about the images Microsoft makes available for you on Docker Hub, how to use them, how to get started .. all!
- Using images, you can combine the “microsoft/dynamics-nav” with a tagname. Tagnames can be found here. The syntax of the tagname is: [version[-cu][-country]]
… we’ll start with the simplest of things.
I need to build a local Demo environment for my sessions at NAVTechDays. All I need seems to work – and was set up in no time (I simply wanted a DEV and an TEST server on the same machine).
Only three steps:
- A VM on Hyper-V that is preloaded with Windows Server 2016. Not really mandatory, but I like to keep my host as clean as possible.. so I use VMs all over the place..
Install Docker. For this, we have these links that can help you easily:
Personally, I will never install docker on Windows 10, as I don’t believe that “any kind of server” belongs on a Windows 10 operating system. But it’s up to you ;-).
On top of this, I made sure the navcontainerhelper was on my machine as well, by simply downloading it from the PowerShell Gallery in PowerShell:
find-module 'navcontainerhelper' | install-module
Install your servers. I wanted 2 servers: a “DEVServer” and a “TESTServer”. Already having the “navcontainerhelper”, this is just a piece of cake! Consider the code below, where “New-CSideDevContainer” is a function that comes with the navcontainerhelper .. and makes it very simple to set up your environments.
$password = 'waldo1234' New-CSideDevContainer ` -containerName 'DEVServer' ` -devImageName microsoft/dynamics-nav:devpreview ` -licenseFile 'https://www.dropbox.com/s/YourDEVLicense.flf?dl=1' ` -vmAdminUsername admin ` -adminPassword (convertTo-SecureString -String $password -AsPlainText -Force) ` -memoryLimit 3G ` -updateHosts ` -auth NavUserPassword ` -accept_eula ` -Verbose New-CSideDevContainer ` -containerName 'TESTServer' ` -devImageName microsoft/dynamics-nav:devpreview ` -licenseFile 'https://www.dropbox.com/s/YourDEVLicense.flf?dl=1' ` -vmAdminUsername admin ` -adminPassword (convertTo-SecureString -String $password -AsPlainText -Force) ` -memoryLimit 3G ` -updateHosts ` -auth NavUserPassword ` -accept_eula ` -Verbose start 'http://devserver/nav' start 'http://testserver/nav'
I know Freddy is working on sharing blogs that explain different “user scenarios” he has come up with. I’m very much looking forward to those! Keep a close eye on his blog..