Installing Docker..Importing Module BCContainerHelper ..Downloading Artifacts

Hello Everyone, this blog will guide you through the docker artifacts, also it consists of mentioned sources which really helped me a lot to work upon them thoroughly. I faced multiple challenges but alas this is the way we LEARN:)

1. To install Docker on Windows Server, you can use a OneGet provider PowerShell module published by Microsoft called the DockerMicrosoftProvider.

Run the command below on your powershell :

Install-Module -Name DockerMsftProvider -Repository PSGallery -Force

2. After the installation completes, restart the computer.

3. You can check the installed version of docker by the command :

Get-Package -Name Docker -ProviderName DockerMsftProvider

4. Follow this command to start docker :

Start-Service Docker

5. After the docker has been installed ,Use the BcContainerHelper to work with containers for Business Central.
Run the command to install the module :

Install-Module BcContainerHelper -force

Image for post

7. Running Update-Module or Install-Module can throw an error like one of the following:

Image for post
Get-PSGalleryApiAvailability : PowerShell Gallery is currently unavailable. Please try again later.
........... (cutted)

Resolving it (Microsoft Way) — use this command below which will change the security protocol to TLS 1.2.

[Net.ServicePointManager]::SecurityProtocol = [Net.ServicePointManager]::SecurityProtocol -bor [Net.SecurityProtocolType]::Tls12

Source : https://dev.to/darksmile92/powershell-disabled-support-for-tls-1–0-for-the-gallery-update-module-and-install-module-broken-1oii

8. NOTE: I think it is possible to have both modules loaded at the same time using the allowclobber switch, but I strongly recommend that you remove all containers and uninstall navcontainerhelper before installing bccontainerhelper (remember to restart PowerShell after uninstalling NavContainerHelper)

Source : https://freddysblog.com/2020/08/11/bccontainerhelper/

9. Now that the module has been installed , BcContainerHelper uses local path as c:\programdata\bccontainerhelper

10. Fire the commands below to work with artifacts

These commands are well discussed in this blog , where if you are not familiar with the artifacts.

$artifactUrl = Get-BCArtifactUrl -version “X.X” -country w1 -select closest

echo $artifactUrl

Download-Artifacts -artifactUrl $artifactUrl -includePlatform

Source : https://freddysblog.com/2020/08/11/bccontainerhelper/

Image for post

11. Next step would be creating a BC container for the same

$credential = New-Object pscredential ‘admin’, (ConvertTo-SecureString -String ‘P@ssword1’ -AsPlainText -Force)
New-BcContainer `
-accept_eula `
-containerName test `
-artifactUrl $artifactUrl `
-Credential $credential `
-auth UserPassword `
-updateHosts
Image for post

Source : https://freddysblog.com/2020/08/11/bccontainerhelper/

12. Yes, we pulled it off well!!!

Image for post
Image for post

Published by tanyakharbanda95

Hello Everyone, I am Tanya Kharbanda,Technical Consultant for NAV and Business Central,holding up 1.7 years of experience in my learning process for this product.Besides, love to be a part of this community and feel devoted in helping people for more in this world of Dynamics. All the content and views are of my own - " As we look ahead into the next century, leaders will be those who empower others. " - BILL GATES Twitter : https://twitter.com/tanya_kharbanda LinkedIn : https://www.linkedin.com/in/tanya-kharbanda-1416b2127/

Create your website at WordPress.com
Get started
%d bloggers like this: