Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

Troubleshooting NAV on Docker

With the release of official NAV images on Docker Hub, we will probably see a larger uptake of people trying this great technology. In this post I have included the issues people are typically running into when trying out NAV on Docker. The first two topics are only relevant on Docker CE (Community Edition), which currently is the only Docker version you can install on Windows 10.

This list is by no means exhaustive and I will update this post if I discover other things, that people run into. Note that this troubleshooting post is not intended to cover advanced usage of NAV Containers, just cover the basic things to get you going. If you can start the simplest NAV Container and the advanced NAV Container setup doesn't work, it is my assumption that the problem is somewhere in the configuration parameters or scripts.

1. Is Docker setup for Windows Containers?

When running Docker CE for Windows 10, you have to switch Docker to Windows Containers (default is Linux Containers). Right click the Docker icon and select Switch to Windows Containers, like explained here.

2. Are you giving the container enough memory?

By far, the most common error people face when running the NAV on Docker image is forgetting to allocate memory when running Hyper-V isolation (which is the only option on Windows 10 at this time). When running Hyper-V isolation, Docker by default gives each container 1GB of memory and that is not enough for the NAV+SQL+IIS inside the NAV Container. The container will fail during initialization in random places, sometimes indicating that the problem is memory or that the NAV Service Tier is not running.

The solution to this problem is to insert a memory allocation (-m 4G or --memory 4G) in the docker run command. 4GB is more than enough and depending on what you are going to use NAV for, less could do. The full docker run command could look like:

docker run --env accept_eula=Y --memory 4G microsoft/dynamics-nav

A caveat here is of course to make sure that you have enough memory left on the host computer. You could also try with 3G or 2500M instead of 4G.

3. Is Docker properly installed?

The NAV image on Docker is a fairly complicated image and you can specify a lot of different parameters to configure NAV to suit your needs. Before filing an issue with a dump from the output on http://www.github.com/microsoft/nav-docker/issues please try the following:

docker run -it --name myserver microsoft/windowsservercore cmd

This should start a windowsservercore image and place you in a Cmd prompt inside the Container. Press Exit to exit the container. If this fails, then Docker is not properly installed on the machine. Use

docker rm myserver -f

to delete the container again.

4. Is the network working?

Docker is doing an amazing job on the network side, typically it just works. I have however seen a number of people (including one of my machine) having one problem on the name resolution. Try to create a container with a specified hostname:

docker run -itd --name myserver --hostname myserver microsoft/windowsservercore cmd

Now, you should be able to ping myserver:

ping /4 myserver
Pinging myserver [172.19.152.52] with 32 bytes of data:
Reply from 172.19.152.52: bytes=32 time

The problem I have on my machine is, when I connect to the Microsoft Corporate network, then Docker name resolution will stop working:

ping /4 myserver
Pinging myserver.redmond.corp.microsoft.com [10.137.86.122] with 32 bytes of data:
Request timed out.
Request timed out.
Request timed out.
Request timed out.

The only solution I have found to this problem is to add an entry to the hosts file in c:windowssystem32driversetc to specify that 172.19.152.52 is myserver. Use

docker rm myserver -f

to delete the container again.

5. Does the LicenseFile parameter really point to a license file?

If you are using a secure Url to specify the license file, does it really yield a license file - or is it the Url to a page in which you can download the license file. If you are using DropBox (Copy DropBox Link) to create a secure Url, you will need to replace dl=0 with dl=1 like explained in this blog post.

If you are specifying a file path to the License file, then you need to make sure, that the license file is accessible from inside the container given that file path. If f.eks. you have placed the file in c:templicense.flf on the docker host - and you specify that the licensefile is in c:hosttemplicense.flf, then you need to insert the -v c:temp:c:hosttemp as a parameter to your docker run command, for the temp folder to be accessible from inside the container as c:hosttemp.

docker run -e accept_eula=Y -e licensefile=c:hosttemplicense.flf -v c:temp:c:hosttemp -m 4G microsoft/dynamics-nav

Enjoy

Freddy Kristiansen
Technical Evangelist

Share the post

Troubleshooting NAV on Docker

×

Subscribe to Msdn Blogs | Get The Latest Information, Insights, Announcements, And News From Microsoft Experts And Developers In The Msdn Blogs.

Get updates delivered right to your inbox!

Thank you for your subscription

×