Quickly create docker container for Dynamics 365 Business Central

If you work with Dynamics 365 Business Central as a developer then you more than likely know about the excellent BContainerHelper used to download artifacts and create containers.

Wanting a quick way to utilize this, I created my own module than leveraged this – well today it got an overdue update.

Mine can be found here, installing it is a mere command away

Install-Module -Name bc365-create-container

Using it, simple, in its simplest form, the following will get you going

New-BC365Container -ContainerName *name* -Auth NavUserPassword

Simply specify your container name, then follow through the prompts to select type (OnPrem/Sandbox), language version etc and it will do the work for you.

In the recent update however, I’ve added commands to get the preview and the insider builds (if you’re a Partner like us, and have access to them).

For the preview, just add -Preview $true, so

New-BC365Container -ContainerName *name* -Auth NavUserPassword -Preview $true

For insider builds, it would be

New-BC365Container -ContainerName *name* -Auth NavUserPassword -Insider $true

Simple as that. As a final note, when my containers have been created I always like to run the following to make sure the containers don’t auto start with windows each time

docker update *name* --restart=no

Powershell module for creating Microsoft Dynamics 365 Business Central docker containers using artifacts – New version

Getting the public preview Business Central Docker artifacts for you local containers

I’ve just released a new version of my powershell module that I use to create my local docker instance of Business Central.

Nothing too fancy, but there is now an extra parameter you can pass to make it look at the Public Preview releases..

The new parameter is -Preview. So to use it you would type something like:

New-BC365Container -ContainerName yourname -Auth NavUserPassword -SSL $true -Preview $true

That’s it, the new version is 0.0.7, (apt timing with the version number;)).

Be sure to get it by using the Install-Module command:

Install-Module bc365-create-container

Stopping a Docker container from auto starting

I’ve started to use docker, and thus containers, a lot more recently.

One thing I have noticed is once a container has been created, when I start my computer up it auto starts the containers. Now, while good for some, I simply don’t want all my dev Docker containers auto starting. So how do we stop this… well… read on.

If the RestartPolicy of the container is set to always then it will restart, you can check this by typing

docker inspect my-container

Look for the RestartPolicy section in the output

To change the policy, type:

docker update --restart=no my-container

Where my-container is your container name.

Thats it, when you restart your computer your container will no longer auto start.