Skip to main content

Running a container-based development environment

For a variety of purposes such as development, testing, trials, it might be useful to deploy Business Central on Docker. In this guide, you will find our take and a sample deployment script to deploy your local instances of Business Central running on Docker.

We also have a video tutorial that guides you through the entire process:

Prerequisites

To follow along, make sure you have downloaded and installed Docker Desktop, and switch to Windows containers.

We have created an opinionated PowerShell script that's essentially a wrapper around the BcContainerHelper module. It makes a number of assumptions that reduces the amount of configuration required to get the Docker container running. There is nothing special about this script as it's merely a wrapper around New-BcContainer, so feel free to change the script as you see fit.

However, if you want to use the script as is, make sure to comply with the following requirements:

  • Create the directory tree C:\docker\DS. This is where the shared drive will be between Docker and Windows.
  • Download and store the .bclicense license file in C:\docker\DS\ as BC.bclicense.

Deploying the container

Open your PowerShell terminal as administrator, and install the script that is published on the PowerShell Gallery.

Install-Script -Name DimeScheduler.BCContainer

To get and set the location of the script, run the following command:

cd (Get-InstalledScript -Name "DimeScheduler.BCContainer").InstalledLocation

To run the script:

.\DimeScheduler.BCContainer.ps1

The default parameters will be used if you don't specify any arguments upon invocation of the script:

ParameterDefault
-version24.0
-nameBC24
-isNavfalse
-sharedDriveC:\docker\DS
-licenseFileC:\docker\DS\BC.bclicense
-useradmin
-adminadmin
-useShortcutstrue
-includeTestToolkitfalse
-memoryLimit8G
-dns8.8.8.8

It may take a few minutes before the base image is pulled and deployed to the NAV container. If all went well, you should have a running instance of the container, which is accessible at http://bc24/BC, as shown in the output:

Container IP Address: 172.24.17.49
Container Hostname : bc24
Container Dns Name : bc24
Web Client : http://bc24/BC/
Dev. Server : http://bc24
Dev. ServerInstance : BC
Setting bc24 to 172.24.17.49 in host hosts file

Files:
http://bc24:8080/ALLanguage.vsix

WARNING: You are running a container which is 138 days old.
Microsoft recommends that you always run the latest version of our containers.

Initialization took 85 seconds
Ready for connections!
Reading CustomSettings.config from bc24
Creating Desktop Shortcuts for bc24

The credentials are also provided in the script. By default, the extremely safe admin/admin user password combo is used.

Deploy extension

This step is documented already, which we shall reiterate in this section. When the provisioning scripts have finished, a few shortcuts will have been added to your desktop:

  • BC24 PowerShell Prompt
  • BC24 Web Client
  • BC24 Command Prompt

In the terminal, you can install the extension using our installation script DimeScheduler.InstallBCExtension.ps1 that's available on the PowerShell Gallery:

Install-Script -Name DimeScheduler.InstallBCExtension

Set the current directory of your terminal to the location where the script is installed:

cd (Get-InstalledScript -Name "DimeScheduler.InstallBCExtension").InstalledLocation

You can now simply run the following command, that deploys the extension for BC24 on server instance BC:

.\DimeScheduler.InstallBCExtension.ps1 -serverInstance BC -version 24                    

Connection with Dime.Scheduler

If all went well, the extension will be available after a few moments. When that moment has come, hit ALT Q in Business Central and look for Dime.Scheduler FastTrack Wizard. This wizard establishes a connection with Dime.Scheduler and helps you configure the modules of interest.

Follow the instructions as documented here, and bear in mind the following remarks:

  • Connection:
    • Scheduler Url: make sure to use https://sandbox.api.dimescheduler.com
    • User: create a user in Dime.Scheduler of type 'Forms'.
    • Password: when a new user is created in Dime.Scheduler, a random initial password is assigned to that user and is shown in the browser. Copy this value and paste it in the Scheduler Password field.
  • Resources: Enable the resources module. The default settings in this tab can remain as is.
  • Modules: enable at least one of the modules in the next tabs. Service orders and projects can be used immediately as this instance of BC already contains a small data set. When enabled, keep the default values and finish the wizard.

Once the wizard has completed, a number of resources will have been added to Dime.Scheduler, and the 'Send to Dime.Scheduler' buttons in the ribbon under 'Actions' will be made available in the modules that have been activated.

Connection with Business Central

Follow the instructions as documented here, and bear in mind the following remarks.

The path http://bc24/BC is only going to work on your workstation. The SOAP URI http://bc24:7047/BC/WS/CRONUS%20International%20Ltd./Page/Appointment works just fine locally, but this address is not known by Dime.Scheduler, that is hosted in the cloud, which will result in errors when you plan a task there.

For Dime.Scheduler to send data back to your local BC Docker container, you should run a tunnel such as ngrok:

ngrok http http://bc24:7047

This will forward requests from urls such as 'https://00fe-90-168-252-235.ngrok-free.app' to 'http://bc24:7047'.

In the connector setup in Dime.Scheduler, replace the host part ('bc24:7047') from the original SOAP address by the output that ngrok has generated, and should eventually look like this sample URL:

https://7539-90-168-252-235.ngrok-free.app/BC/WS/CRONUS%20International%20Ltd./Page/Appointment.