A docker container is a standardized unit of software, which is available for both Linux and Windows. It can isolate software from its surroundings and help reduce conflict between the team running different software in the same infrastructure with less computing and RAM using characters. Now with the above good characters, you may want to try to deploy a docker container in Windows Server 2016. In this post, we would talk about deploying a docker container in Windows Server 2016 via PowerShell.

Installing the container feature and the docker engine

Step 1: Open the administrative PowerShell and install the new containers feature. Then type the under command into the PowerShell.

Install-WindowsFeature -Name Containers -Restart

Note: PowerShell is a powerful tool to manage Windows Server 2016, it is not only can be used to deploy some software but also can be used to back up some system state for Windows Server.

Step 2: Create a location to store the docker program files.

Note: Here i just choose a location in my system volume C to store the docker program file, you can adapt the location for your condition.

Step 3: Download the docker engine (daemon in UNIX language) and the docker client from the Microsoft servers by following the under commands.

Step 4: Add the docker directory to the system path so we can call the docker client from wherever we are in the file system

Step 5: Restart the PowerShell to activate the changes in environment and type the under command to wrap up the pre-installation process.

Step 6: Download some docker images from the Microsoft servers by installing the container image package provider. Then restart the docker service.

Step 7: Use docker run to deploy a new container named coreserver3 that uses the Windows Server Core image. The -it switch denotes an interactive session, and cmd.exe means that we want to enter the container inside a new cmd.exe console.

Step 8: Press Ctrl+P+Q at same time to switch out of the running container. Then we can say that you have deployed a docker container in Windows Server 2016 successfully.

Related