Skip to main content

Running a container-based development environment

Running Business Central on Docker gives you a disposable local instance, which is handy for development, testing, and trials. This guide walks you through deploying one with a sample script, then connecting it to Dime.Scheduler in both directions.

Prefer to watch? This video tutorial covers the entire process:

Prerequisites

Download and install Docker Desktop, then switch it to Windows containers.

We have published an opinionated PowerShell script that wraps the BcContainerHelper module. It makes a number of assumptions that cut down the configuration needed to get the container running. Under the hood it simply calls New-BcContainer, so feel free to adapt it to your needs.

To use the script as is, meet these requirements first:

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

Deploying the container

Open a PowerShell terminal as administrator and install the script from the PowerShell Gallery.

Install-Script -Name DimeScheduler.BCContainer

Move to the location where the script was installed:

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

Run the script:

.\DimeScheduler.BCContainer.ps1

If you don't pass any arguments, these default parameters are used:

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

Pulling the base image and deploying it to the NAV container can take a few minutes. Once it finishes, you have a running instance accessible at http://bc24/BC, and the output looks like this:

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 printed in the script output too. By default you get the very safe admin/admin combination.

Deploy extension

The full procedure is already documented; this section recaps it. When the provisioning scripts finish, you will find a few shortcuts on your desktop:

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

Install the extension with our installation script DimeScheduler.InstallBCExtension.ps1, available on the PowerShell Gallery:

Install-Script -Name DimeScheduler.InstallBCExtension

Move your terminal to where the script was installed:

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

Now run the following command, which deploys the extension for BC24 on server instance BC:

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

Connection with Dime.Scheduler

The extension becomes available after a few moments. Once it does, press 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 you care about.

Follow the instructions documented here, keeping these points in mind:

  • Connection:
    • Scheduler environment: use the Sandbox option.
    • 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 and shown in the browser. Copy this value and paste it into the Scheduler Password field.
  • Resources: enable the resources module. The default settings on this tab can stay as they are.
  • Modules: enable at least one of the modules on the next tabs. Service orders and projects work right away, since this BC instance already contains a small data set. When you enable them, keep the default values and finish the wizard.

Once the wizard completes, several resources are added to Dime.Scheduler, and the 'Send to Dime.Scheduler' buttons in the ribbon under 'Actions' become available in the modules you activated.

Connection with Business Central

Follow the instructions documented here, keeping the following in mind.

The path http://bc24/BC only works on your workstation. The SOAP URI http://bc24:7047/BC/WS/CRONUS%20International%20Ltd./Page/Appointment works fine locally, but Dime.Scheduler, which is hosted in the cloud, does not know this address, so planning a task there results in errors.

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

ngrok http http://bc24:7047

This forwards 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') of the original SOAP address with the output ngrok generated. The result should look like this sample URL:

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