How to copy a local docker container/image to another computer (Business Central)

Hi guys,

i got a new Laptop and i want to copy my container from the old computer to the new one.

While doing so i got a lot of different errors.

What i did until now:

  1. commit the container to an image

  2. save the image in a .tar file

  3. load the image on the other computer

  4. trying to run the image (not working: “You must share a DVD folder to C:NAVDVD or a file system to C;\NAVFS in order to run the generic image”)

Can someone provide a step by step guide for this please?

Hey I figured out myself :slight_smile:

Tools:

  • PowerShell, Docker, NavContainerHelper, Git, VsCode
  • Conditions:
  • Installation of Docker
  • Nav Image/Installation?
  • NavContainerHelper
  • Code saved in a Git repository

Helpful:

Show Images:

docker images

Show Container:

docker ps -a
  1. Create image of a container
docker commit CONTAINER [REPOSITORY[:TAG]]

Explanation:

CONTAINER is the container ID [REPOSITORY[tag]] is the name of the new image

Example:

$ docker commit c3f279d17e0a synalis/neuesimage:version1

Read More:

https://docs.docker.com/engine/reference/commandline/commit/

  1. Save image

Example:

docker save -o IMAGE [IMAGE…]

Explanation:

IMAGE is the name of the .tar file [IMAGE…] is the name of the image

Example:

$ docker save -o fedora-all.tar fedora

Read More:

https://docs.docker.com/engine/reference/commandline/save/

  1. Load Image

Example:

docker load --input fedora.tar

Read More:

https://docs.docker.com/engine/reference/commandline/load/

  1. Create new container

PowerShell Script:

$password = ConvertTo-SecureString -String "TypeYourPasswordHere" -AsPlainText -Force #put your wished password here
$credential = New-Object PSCredential 'TypeYourUsernameHere', $password #put your wished username here
New-BCContainer -accept_eula -accept_outdated -updatehosts `
                -imageName 'fedora' ` #put your image name here
                -containerName 'TypeYourContainerNamehere' ` #put your container name here
                -auth UserPassword -Credential $credential `
                -licenseFile 'C:\Users\YourDirectory\license.flf' #put your directory of the license here
  1. Clone/pull your git

  2. Open project in VsCode

Download symbols (Press F1, Type in AL: Download Symbols)

Create package (Press F1, Type in AL: Package)

Publish App (Press ctrl + F5)

That’s a great follow up, thanks for posting that! So you basically make a local image from your container, and that works when you copy it to another computer?

Yes a very interesting approach, it would have been my guess that it would not have worked.

Yes I have tried to do that too some while ago.

That would in fact be an “easy” way to distribute a full solution incl. test data to the developers on our project.