Docker@waldo – My Local Demo Environment

Well – I guess there is no way around – Docker is the way forward, and you’d better get on the train!

Getting started

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]]

 

Today…

… 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..

5.00 avg. rating (98% score) - 3 votes

Permanent link to this article: https://www.waldo.be/2017/11/03/dockerwaldo-my-local-demo-environment/

11 comments

4 pings

Skip to comment form

  1. FYI – A new version of navcontainerhelper coming today, where I had to add a -accept_eula switch to the new-navcontainer and new-csidedevcontainer.

      • waldo on November 3, 2017 at 7:04 am
        Author

      Thanks for letting me know!
      So that’s going to be a “Update-Module navcontainerhelper -Verbose” 🙂

  2. The code above has now the “-accept_eula” parameter, which is mandatory from today on …

  3. Hi,

    no, I actually don`t have a blog 😉

    I am going to use your phrase and modify it a bit: “My English BY FAR is not perfect – so I wouldn’t feel comfortable.” 😉

    Anyway, for this purposes you can use the topic related github repos:
    https://github.com/Koubek/nav-docker-examples (examples with the NAV on Docker basics)
    https://github.com/Koubek/dockerfiles-dynamics-nav (this is discontinued project but you can see our very first intentions to start with Docker on NAV)

    Again, thanks for your post!!!

      • waldo on November 3, 2017 at 12:52 pm
        Author

      Thanks, Jakub! Very valuable!

    • BVL on November 6, 2017 at 1:53 pm
    • Reply

    $password = ‘MyPWD2017’
    New-CSideDevContainer `
    -containerName ‘DEVServer’ `
    -devImageName microsoft/dynamics-nav:devpreview `
    -licenseFile ‘C:\DEMO\License\Cronus.flf’ `
    -vmAdminUsername admin `
    -adminPassword (convertTo-SecureString -String $password -AsPlainText -Force) `
    -memoryLimit 3G `
    -updateHosts `
    -auth NavUserPassword `
    -accept_eula `
    -Verbose

    the “published” DEVServer CSIDE can’ t connect with the login, beacuse the admin does not has any SQL rights.

    Greetz,
    Benny

      • waldo on November 6, 2017 at 6:43 pm
        Author

      It’s best to log your issues here:
      https://github.com/microsoft/navcontainerhelper

      • waldo on November 6, 2017 at 7:45 pm
        Author

      by the way – try “sa” in stead of “admin”..

      • BVL on November 7, 2017 at 8:05 am

      Indeed, “sa” worked!

    • PleachiM on November 21, 2017 at 8:29 am
    • Reply

    Thank you Waldo for your great post and for the interesting way you have done your Sessions on Techdays. I got it to work with you help and the help of freddy.
    Just one thing I noticed. I installed the C/AL Extension for VS Code BUT I pulled the latest docker image. In my case it was not possible to Download symbols. So I had to manually uninstall the extension in VSCode and also a double click on the vsix from the server was not working and was throwing an error. So I installed the vsix language extension directly in VSCode. After this it worked like a charm 🙂

    ah and thank for the hint with sa user 😉

      • waldo on November 30, 2017 at 12:11 pm
        Author

      Very welcome! 🙂

  1. […] NAV 2018 BE localisation in a docker container. To get started on Docker i’ll refer you to this excellent (as always) blog of […]

  2. […] Docker@waldo – My Local Demo Environment […]

  3. […] you might af read in my previous post, I am setting up a demo environment to be used during my session at […]

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.