Business Central Docker: Quick Start Guide
There are already many detailed guides on how and why we can use Docker to emulate Business Central on both OnPrem and Cloud versions. But I wrote short instructions, according to which you can quickly recall any command that you forgot and refresh your memory. Also, this information will help beginners who still do not understand why all this is needed.
Quick Guide
- Install Docker
Go to Developers - Docker and download docker desktop application. Install it. - Enable Hyper-V
Go to Windows PowerShell, run it as administrator, put command to enable Hyper-V:
Enable-WindowsOptionalFeature -Online -FeatureName $("Microsoft-Hyper-V", "Containers") -All - Install BcContainerHelper
Put command into PowerShell:
Install-Module BcContainerHelper -force
If you got an error just install PowerShell package manager, put command into PowerShell:
Install-Module -Name PowerShellGet -Repository PSGallery -Force - Reboot PC
Reboot is required due to Hyper-V installation - Switch to Windows Docker
Go to Windows right bottom corner, find Docker icon, right-click and select "Switch to Windows containers" - Get Artifact Url
To start BC installation process you must find Artifact Url for your specific BC version, just put command in PowerShell:
Get-BcArtifactUrl -type sandbox -country us -select Latest
-type sandbox or onprem
-country BC localization
-select your specific version or Latest
If you have an error "that script is not signed" you need just to change PS script execution policy by command:
Set-ExecutionPolicy -ExecutionPolicy Unrestricted -force -scope LocalMachine - Download and Install BC image
Put command in PowerShell:
New-BCContainer -includeAL -containerName <SandboxName> -accept_eula -auth NavUserPassword -ACCEPT_OUTDATED -artifactUrl <artifactUrl> -updateHosts -includeTestToolkit -includeTestLibrariesOnly -assignPremiumPlan - Set username and password
In the installation process, you will have a pop-up window where you must type your new UserName and Password. Password must contain lowercase and uppercase, number, and symbol.
We have installed the docker and BC Image version we need, pay attention to the shortcuts created during the installation, with them, you can access the base and consoles of the images.
Links
This short note will not be enough to deep work with the docker and BC Artifact, so I decided to compile a list of useful resources on this topic.