Docker desktop for windows server 2016

This multi-part blog series will show how to configure, build, and run Docker containers on Windows. The first part showed how to setup Windows Server 2016 on Virtual Box for Docker Containers. This part will install the operating system images and configure Docker. Instructions are available at msdn.microsoft.com/virtualization/windowscontainers/deployment/deployment.

How to Install Docker in Windows Server 2016 Container Feature

Start PowerShell:

windows-2016-docker-1-

Install the container feature:

windows-2016-docker-2

Restart the Virtual Machine:

windows-2016-docker-3

Install Windows Server 2016 Base Docker Image

Base operating system can be installed using ContainerImage PowerShell module. Install the module as:

windows-2016-docker-4

See the list of operating system images that are available:

windows-2016-docker-5

Install the Windows Server Core base OS image:

windows-2016-docker-6

windows-2016-docker-7

Install Docker on Windows Server 2016

Download the script to install Docker:

windows-2016-docker-8

Run the script:

windows-2106-docker-9

Check Docker version:

windows-2016-docker-11

Check the list of images and tag the base OS image to latest:

windows-2106-docker-10

Check docker --help command:

 windows-2016-docker-12

Subsequent blogs will show how other fun things with Docker on Windows Server 2016!

Some further topics to read …

  • Windows Server Containers – Quick Start
  • Windows Server 2016 Technology Preview 5
  • Docker Documentation
  • Getting Started with Docker for Java developers

Posted by Arun Gupta, VP, Developer Advocacy, Couchbase

Arun Gupta is the vice president of developer advocacy at Couchbase. He has built and led developer communities for 10+ years at Sun, Oracle, and Red Hat. He has deep expertise in leading cross-functional teams to develop and execute strategy, planning and execution of content, marketing campaigns, and programs. Prior to that he led engineering teams at Sun and is a founding member of the Java EE team.

Gupta has authored more than 2,000 blog posts on technology. He has extensive speaking experience in more than 40 countries on myriad topics and is a JavaOne Rock Star for three years in a row. Gupta also founded the Devoxx4Kids chapter in the US and continues to promote technology education among children. An author of several books on technology, an avid runner, a globe trotter, a Java Champion, a JUG leader, NetBeans Dream Team member, and a Docker Captain, he is easily accessible at @arungupta.

How to Install and Run Docker on Windows Server 2016, 2019, 2022. In this tutorial we will introduce Docker and how it works with it’s main advantages then move onto installation phase with how to install Docker using PowerShell.

Docker is one of the most widely used containerization platform used by developers. It allows developers to create, deploy, and run applications with the help of containers.

Next in this article How to Install and Run Docker on Windows Server 2016, 2019, 2022 is to introduce Docker.

What Is Docker?

install and Run Docker on Windows Server 2016, 2019, 2022.

The Docker is an open source platform that allows you to build, deploy, run, update, and manage containers. They are standardized, executable components that integrate application source code with operating system libraries and dependencies they need to run that code in any environment.

With the help of containers, the process of simplifying the development and delivery of distributed applications becomes effortless. The platform is highly popular among organizations transforming themselves to cloud native developments and hybrid multi cloud environments. Therefore, by using Docker, you will tend to acquire the following additional advantages:

Docker Benefits

  • Light Weight – The Docker containers do not have to carry the payload of an entire OS instance and hypervisor. They only require the OS processes and dependencies for executing the code. Also, since their sizes are measured in megabytes, you can make better use of hardware capacity and have faster start-up times.
  • Greater Resource Efficiency – With the help of Docker containers, you can run several copies of the same application on the hardware as many times as you want, thereby reducing cloud spending.
  • Improved Developer Productivity – Write and run only once a time a containerized application anywhere. In comparison to VMs, they will run faster and deploy, provision and restart effortlessly. This way, you can make them ideal for usage in continuous integration and continuous delivery (CI/CD) pipelines. It will also be a better fit for development teams adopting Agile and DevOps practices.
  • Improved And Seamless Container Portability – Docker containers tend to run without modification across any desktop, data center, and cloud environment.
  • Automated Container Creation – Docker tends to build a container automatically according to the application source code.
  • Shared Container Libraries – Docker enables you to access open source libraries, which include numerous user contributed containers.
  • Containers Reuse – In Docker, you can use existing containers as base images, especially templates for building new containers.
  • Container Versioning – Docker trackers the versions of a computer image, get back to previous versions and then identify who built it and when. They also upload only deltas between an existing version and a new one.

Moreover, if you use containers, you tend to acquire benefits, like improved app quality, faster response to market changes, etc.

How Does Docker Work?

how docker works

Docker work by packaging, provisioning, and running containers. Its technology is available to the operating system. A container packages the application service or function will every library, configuration files, dependencies, and other necessary parts and parameters to operate. Every container contributes to the service of one underlying operating system.

Moreover, Docker images constitute the dependencies required for executing code inside a container. This way, containers that move between Docker environments with similar OS work with no changes.

Docker also uses resource isolation in the OS Kernel to run several containers on the same OS. It is not as same as Virtual Machines (VMs) that encapsulate an entire OS with executable codes on an abstracted layer of physical hardware resources.

On the other hand, Docker was developed to work on the Linux platform. However, it has extended its offer to provide support to non Linux Operating systems too. It includes Microsoft Windows and Apple OS X. Docker also has the version for Amazon Web Services (AWS) and Microsoft Azure.

Next in this post we will show you how to install and run Docker on Windows server 2016 / 2019 and 2022.

Enable the Containers Feature

By default, the container features are not enabled on Windows server machine. So you will need to enable it first.

				
					Install-Module -Name DockerMsftProvider -Repository PSGallery -Force
				
			

The above command will install the Docker-Microsoft PackageManagement Provider from the PowerShell Gallery. 

Run Docker Engine on Windows in Azure

Run Docker Engine on Windows in AWS

Run Docker Engine on Windows in GCP

Install Docker Engine

After the Containers feature is enabled on Windows Server, open your powershell windows and install the latest Docker Engine and Client by running the command below:

				
					Install-Package -Name docker -ProviderName DockerMsftProvider
				
			

Once the Docker is installed, you will get the following output:

				
					WARNING: A restart is required to enable the containers feature. Please restart your machine.

Name                           Version          Source           Summary                                             
----                           -------          ------           -------                                             
Docker                         20.10.9          DockerDefault    Contains Docker EE for use with Windows Server. 

				
			

Next, you will need to restart your system to enable the docker features. You can run the following command to restart the system:

Verify the Docker Installation

You can verify the installed version of  Docker using the following command in the powershell window:

				
					Get-Package -Name Docker -ProviderName DockerMsftProvider
				
			

You will get the following output:

				
					Name                           Version          Source                           ProviderName                        
----                           -------          ------                           ------------                        
docker                         20.10.9          DockerDefault                    DockerMsftProvider                  
				
			

You can also run the following command to see the Docker version information:

You should see the Docker version information in the following output:

				
					Client: Mirantis Container Runtime
 Version:           20.10.9
 API version:       1.41
 Go version:        go1.16.12m2
 Git commit:        591094d
 Built:             12/21/2021 21:34:30
 OS/Arch:           windows/amd64
 Context:           default
 Experimental:      true

Server: Mirantis Container Runtime
 Engine:
  Version:          20.10.9
  API version:      1.41 (minimum version 1.24)
  Go version:       go1.16.12m2
  Git commit:       9b96ce992b
  Built:            12/21/2021 21:33:06
  OS/Arch:          windows/amd64
  Experimental:     false

				
			

If you want to get detailed information of Docker package, run the following command:

You should see the following output:

				
					Client:
 Debug Mode: false
 Plugins:
  cluster: Manage Docker clusters (Docker Inc., v1.1.0-8c33de7)

Server:
 Containers: 0
  Running: 0
  Paused: 0
  Stopped: 0
 Images: 0
 Server Version: 19.03.2
 Storage Driver: windowsfilter
  Windows: 
 Logging Driver: json-file
 Plugins:
  Volume: local
  Network: ics l2bridge l2tunnel nat null overlay transparent
  Log: awslogs etwlogs fluentd gcplogs gelf json-file local logentries splunk syslog
 Swarm: inactive
 Default Isolation: process
 Kernel Version: 10.0 14393 (14393.3808.amd64fre.rs1_release.200707-2105)
 Operating System: Windows Server 2016 Standard Version 1607 (OS Build 14393.3808)
 OSType: windows
 Architecture: x86_64
 CPUs: 2
 Total Memory: 3.999GiB
 Name: CLOUD-0Q59R832Q
 ID: BTXL:3ZPL:A7MZ:FNCV:UZRU:VG7I:YU7X:DERR:2Q2Y:2YNL:SYGN:AGYT
 Docker Root Dir: C:\ProgramData\docker
 Debug Mode: false
 Registry: https://index.docker.io/v1/
 Labels:
 Experimental: false
 Insecure Registries:
  127.0.0.0/8
 Live Restore Enabled: false

				
			

Run the Docker Container

Next, download the Docker dotnet nano server container image using the following command:

				
					docker pull mcr.microsoft.com/dotnet/samples:dotnetapp-nanoserver-2009
				
			

Once the image is downloaded, you can run the container from the downloaded image using the following command:

				
					docker run mcr.microsoft.com/dotnet/samples:dotnetapp-nanoserver-2009
				
			

Run Linux Container on Windows

By default, Docker on Windows machine can only run Windows container. In order to use Linux containers on Windows Server, you need to use the Docker Enterprise Edition Preview which includes a full LinuxKit system for running Docker Linux containers.

The first thins is to remove your Windows Docker engine using the following command:

				
					Uninstall-Package -Name docker -ProviderName DockerMSFTProvider
				
			

Secondly,  install Docker for Linux by running the following command:

				
					Install-Module DockerProvider
Install-Package Docker -ProviderName DockerProvider -RequiredVersion preview
				
			

Thirdly, enable LinuxKit system for running Linux containers using the following command:

				
					[Environment]::SetEnvironmentVariable("LCOW_SUPPORTED", "1", "Machine")
				
			

The next step is to  start the Docker service with the following command:

Then download and run your first Linux container using the following command:

				
					docker run -it --rm ubuntu /bin/bash
				
			

This command will download the latest Ubuntu container image, create the container and connect to the container shell as shown below: 

You can now run the following command inside the container to verify the Ubuntu version:

				
					root@21340a2fsf7e2:/# cat /etc/os-release 
 NAME="Ubuntu"
 VERSION="22.04.1 LTS (Jammy Jellyfish )"
 ID=ubuntu
 ID_LIKE=debian
 PRETTY_NAME="Ubuntu 22.04.1 LTS"
 VERSION_ID="22.04"
 HOME_URL="https://www.ubuntu.com/"
 SUPPORT_URL="https://help.ubuntu.com/"
 BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
 PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
 VERSION_CODENAME=Jammy Jellyfish
 UBUNTU_CODENAME=Jammy Jellyfish
				
			

To disconnect from the container, run the following command:

				
					root@21340a2fsf7e2:/# exit
				
			

How to Use Docker

Docker provides many useful commands that help developers or system administrators to easily manage Docker containers from the command line.

You can use the –name option with Docker to assign a container name when running a new container. For example, to launch a new container from the debian:latest images and assigned a name debian-container, run the following command:

				
					docker.exe container run --name debian-container debian:latest
				
			

After starting the container, you can see the status of all container using the following command:

There are two ways of running a container, in attached mode and in detached mode. By default, Docker runs the container in attached mode. In the attached mode, you will be connected to the terminal session, where it displays output and messages.

If you want to run a container in detached mode, use the -d flag:

				
					docker.exe container run -d debian:latest
				
			

You can run a container in interactive mode with Docker. In this mode, you can run commands inside the container. You can use the following command to run a container in an interactive mode:

				
					docker container run -it debian:latest /bin/bash
				
			

If you want to start, stop or remove the Docker container, run the following commands:

				
					docker container start container-name
docker container stop container-name
docker container rm container-name
				
			

Great! You have read How to Install and Run Docker on Windows Server 2016, 2019, 2022 until the very end. let’s conclude. 

How to Install and Run Docker on Windows Server 2016, 2019, 2022 Conclusion

In this post we illustrated how to install Docker CE on Windows server 2016, 2019, and 2022. We also explained how to run dotnet container in Windows server. I hope this guide will help a lot to run and manage the Docker container. Docker’s containers technology makes development highly scalable as it separates your applications from your infrastructure to be able to deliver software quickly. Shipping, testing and deploying the code is made quickly with less delays in applications delivery.

Windows Server provides many great features to run your Docker containers, including Hyper V isolation for additional security and kernel protection. Also, Microsoft Windows Server can run both Windows and Linux containers meaning you can have a mixed environment supporting applications needing both Windows and Linux components.


Readers help support Windows Report. We may get a commission if you buy through our links.

Read our disclosure page to find out how can you help Windows Report sustain the editorial team. Read more

Docker is a useful tool, and many are wondering if it is possible to Install Docker on Windows Server 2016. Join us while we try to answer this question.

Is Docker supported on Windows Server?

Yes, Docker Community Edition/Moby is supported on Windows Server. You can also install containerd, or the Mirantis Container Runtime version.

How do I install Docker on Windows Server?

  1. Open PowerShell.
  2. Run the following commands: Invoke-WebRequest -UseBasicParsing "https://raw.githubusercontent.com/microsoft/Windows-Containers/Main/helpful_tools/Install-DockerCE/install-docker-ce.ps1" -o install-docker-ce.ps1
    .\install-docker-ce.ps1

  3. Follow the instructions on the screen to complete the process.

For containered, the steps are the same but you need to use the following commands instead:
Invoke-WebRequest -UseBasicParsing "https://raw.githubusercontent.com/microsoft/Windows-Containers/Main/helpful_tools/Install-ContainerdRuntime/install-containerd-runtime.ps1" -o install-containerd-runtime.ps1
.\install-containerd-runtime.ps1

Is Docker free for Windows Server 2016?

Yes, Docker is free on Windows Server and Docker Enterprise comes included with with Windows Server license.

Read more about this topic

  • Microsoft’s hotpatching for Windows Server 2025 to be subscription-based starting July
  • Microsoft Office Lens: A Powerful Tool for Capturing and Organizing Information
  • Microsoft releases the Windows Server Build 26360, introducing the WDAC for enhanced security

As you can see, it’s pretty simple to install Docker on Windows Server 2016, but issues with it can occur, and we wrote about Docker CLR error 8000405 and Docker Desktop unexpected WSL error.

Issues can appear on Windows 11 as well, and we have a guide on what to do if the Docker Desktop is starting forever, so don’t miss it.

Did you manage to install Docker? Let us know in the comments.


Aleksandar Ognjanovic

Aleksandar’s main passion is technology. With a solid writing background, he is determined to bring the bleeding edge to the common user. With a keen eye, he always spots the next big thing surrounding Microsoft and the Windows OS.

Focused on Windows errors and how to solve them, he also writes about the OS’s latest features as well as its interface.

In his free time, he likes to read, listen to music, and enjoy the nature. Hiking is one of his newly found passions.


Docker on Windows is a little bit different than on Linux. Because Docker runs using features of the Linux operating system which not supported by Microsoft Windows. To run Docker on windows 10, Docker Toolbox will create a Linux virtual machine in VirtualBox and all containers will be created inside the virtual machine.

In this tutorial we will learn How to Install Docker on Windows 10 using the Docker Toolbox. You can also use following guide to install docker for Windows 7 and Windows Server 2016.

Download Docker Toolbox for Windows 10 / 7 / Server 2016

Go to following URL docker.com/toolbox and download the Docker Toolbox for Windows 10.

Download Docker Toolbox for Windows 10 / 7 / Server 2016

Install Docker Toolbox on Windows 10

After download is finished, run the setup file and install the docker toolbox with default options.

Open Docker Quickstart Terminal

From Windows 10 start menu launch the Docker Quickstart Terminal. The First time, it will run the initial configuration and will create the default virtual machine for the Docker Engine.

Install Docker Windows 10 Quickstart Terminal

Once it is done, you can manage docker from Windows using Quickstart Terminal, Windows CMD, or PowerShell.

To check the Docker version Type:

docker version

Note that Docker Engine is running inside a Virtual Machine also called as ‘Docker Host’ in Windows. If you open VirtualBox you will see a Virtual Machine called ‘default’.

We can manage the Virtual Machine with docker-machine command.

To get information about machines, Type:

docker-machine ls

To Stop default machine, Type:

docker-machine stop default

To start default machine, Type:

docker-machine start default

Run Hello World Docker container on Windows 10

To test Windows Docker Engine, let’s run a simple hello-world container on docker.

docker run hello-world

Docker will download the hello-world Docker Image and start a new container using the hello-world image. If successful you should see the «Hello from Docker» message as shown in the following image.

Windows Docker Container hello-world

This confirms that your Docker installation on Windows 10 / 7 / Server 2016 is successful.

Installing Docker on Windows Server 2016

First, install the Docker-Microsoft PacheManagement Provider from the PowerShell Gallery

PS> Install-Module -Name DockerMsftProvider -Repository PSGallery -Force

Next, you use the PackageManagement PowerShell module to install the latest version of Docker

PS> Install-Package -Name Docker -ProviderName DockerMsftProvider

When PowerShell asks you whether to trust the package source DockerDefault, type A to continue the installation.
When the installation is complete, reboot the computer.

PS> Restart-Computer -Force

Install Docker-Compose

Make sure to include to correct docker-compose version

PS> Invoke-WebRequest https://github.com/docker/compose/releases/download/1.12.0/docker-compose-Windows-x86_64.exe -UseBasicParsing -OutFile $env:ProgramFiles\docker\docker-compose.exe

Uninistall

PS> Uninstall-Package Docker -ProviderName DockerMsftProvider
PS> Uninstall-Module -Name DockerMsftProvider

Понравилась статья? Поделить с друзьями:
0 0 голоса
Рейтинг статьи
Подписаться
Уведомить о
guest

0 комментариев
Старые
Новые Популярные
Межтекстовые Отзывы
Посмотреть все комментарии
  • Windows black edition complete collection
  • Как запустить defender для windows 10
  • Crosshair cursor windows 10
  • Проводник не отвечает windows 11 как исправить
  • Windows media foundation download