Running a Container-Based Development Environment
Dynamics 365 Business Central is available as artifacts for running on Docker on a Windows system with Docker installed.
Get-BCArtifactUrl from the BCContainerHelper PowerShell module to get the artifact URL for the version of Dynamics 365 Business Central that you want.
Install and configure Docker
Install Docker and configure it for Windows Containers.
Please choose the version of Docker that is appropriate for the host operating system.
For Windows 10, switch Docker to use Windows containers. By default Docker Community Edition uses Linux containers.
To switch to Windows containers, in the Taskbar, right-click the Docker icon , and then select Switch to Windows Containers. For more information, see Switch between Windows and Linux containers.
You can run Business Central on Docker using Docker commands, or you can use the BCContainerHelper PowerShell module. The BCContainerHelper module removes a lot of the complexity of running Docker.
Using Docker commands
Open a Command Prompt as Administrator. In the command prompt, identify your version of Windows (example 10.0.19041.329). Run this command to pull the latest version of the generic image used to to run Business Central on Docker:
docker pull mcr.microsoft.com/businesscentral:10.0.19041.329
Use this command to run a sandbox container with the US localization of version 16.3.14085.14363 on Docker:
docker run -e accept_eula=Y -m 4G -e artifacturl=https://bcartifacts.azureedge.net/sandbox/16.3.14085.14363/us mcr.microsoft.com/businesscentral:10.0.19041.329
You must specify the correct Windows Version in the generic image name. If your version of Windows doesn't have a corresponding generic Docker image, you might need to use Hyper-V isolation.
After starting the
docker run command above, you will see log entries similar to the following:
Initializing... Starting Container Hostname is b8c6941bb168 ... Container IP Address: 172.21.4.208 Container Hostname : b8c6941bb168 Container Dns Name : b8c6941bb168 Web Client : https://b8c6941bb168/BC/ Admin Username : admin Admin Password : Zupa5925 Dev. Server : https://b8c6941bb168 Dev. ServerInstance : BC Files: http://b8c6941bb168:8080/ALLanguage.vsix http://b8c6941bb168:8080/certificate.cer Initialization took 66 seconds Ready for connections!
At this point, you can open your browser and type in the Web client URL from the log. You will be prompted to log in with the Admin Username/Password that is shown.
The container image uses a so called self-signed certificate for HTTPS communication. Because of that, your browser might warn you that the page you are requesting is unsafe. In those specific circumstances, and only for test and development environments, it is safe to ignore this warning. If you want to resolve this warning, you can install the certificate on your PC. For more information, see the link under Files in the log entries.
Using the BCContainerHelper PowerShell module
To support the use of containers, optional PowerShell scripts are available, which support setup of development environments. Use the
BCContainerHelper to work with containers. On a Windows 10, Windows Server 2016 or Windows server 2019 machine, start Powershell as an Administrator and type:
install-module BCContainerHelper -force
To see which functions are available in the BCContainerHelper module use the following command:
To get quickly get started, run the following command from the BCContainerHelper module:
$artifactUrl = Get-BcArtifactUrl -type sandbox -country us -select Latest New-BCContainer -accept_eula -containerName mysandbox -artifactUrl $artifactUrl
BCContainerHelper will create a folder on the C:\ drive called bcartifacts.cache for caching artifacts. It will also create a folder under C:\ProgramData called BCContainerHelper and will place all working files underneath that folder. The C:\ProgramData\BCContainerHelper folder will be shared to the container for transfer of files etc. If you do not specify a username and a password, it will ask for your password and use the current Windows username. If you specify your windows password, the container setup will use Windows Authentication integrated with the host. The
BCContainerHelper will also create shortcuts on the desktop for the Dynamics 365 Business Central Web client, a container prompt, and a container PowerShell prompt.
BCContainerHelper module also allows you to add the
-includeCSide switch (For Business Central versions 14 or earlier) in order to add the Dynamics 365 Business Central Windows client and C/SIDE to the desktop and export all objects to a folder underneath C:\ProgramData\BCContainerHelper\Extensions for the object handling functions from the module to work.
Submit and view feedback for