group meeting with notebooks and laptop

September 25, 2018 - By Parwinder Singh

Containers are lightweight, portable feature to run many important services such as SQL, Dynamics 365 Business Central or NAV development or demo environments etc. Windows Server 2016 has built-in functionality for containers. Containers are not actual VMs and do not have a GUI. However, with the help of PowerShell and Command Prompt, they can be managed and can run many services like a VM. But somebody cannot remote [RDP] into a container.

Docker is a very useful extension which can be added to the Windows 10 Pro or above and Windows Servers to create and manage containers. it helps to reduce IT infrastructure and also, reduce costs of expensive hardware.

Docker Useful Commands:

Install Docker:

Install-Module -Name DockerMsftProvider -Repository PSGallery -Force

Install the latest version of Docker after above command:

Install-Package -Name docker -ProviderName DockerMsftProvider

  • Tip: If you want to update Docker later:

Check the installed version with:

Get-Package -Name Docker -ProviderName DockerMsftProvider

Find the current version with: 

Find-Package -Name Docker -ProviderName DockerMsftProvider

When you’re ready, upgrade with: 

Install-Package -Name Docker -ProviderName DockerMsftProvider -Update -Force,

Start Docker Service:

Start-Service Docker

 

Get Installed Docker information:

Docker info

 

List existing images:

Docker images

 

Download Image:

Docker pull <repository>/<product>[:tag]

  •  Example: Docker pull microsoft/dynamics-nav:2018-w1

 

Remove Image:

Docker rmi <image-id>

 

List running containers:

Docker ps

 

List all containers:

Docker ps -a

 

Run new container:

Docker start <image>

 

Start existing container:

Docker start <container>

 

Stop running container:

Docker stop <container>

 

Remove container:

Docker rm <container>

 

Commit changes to container image:

Exit the container: Ctrl + p + q

Stop the container: Docker stop <container id>

Check the existing containers: Docker ps -a

 

Finally, commit the changes: Docker commit <container id> <tag>

  •  Example:  docker commit 138ce51324f8 microsoft/bcsandbox:12.2.22932.23097-us

 

Check if the new image has created:

Docker images

 

Create AAD users in Container App:

Create-AadUsersInNavContainer -containername <containername>

 

 Run/Create docker container:

Docker run -e accept_eula=Y microsoft/dynamics-nav

Windows 10/Hyper-V isolation specific:

Docker run -m 3G -e accept_eula=Y microsoft/dynamics-nav

 

The above command reserves 3GB of memory, even if NAV only needs 1GB

Share this story: