Tutorial run Docker Containers on Windows Server 2019. Docker has made it possible to run processes and softwares separately in a completely isolated environment on the Linux kernel, which is called the Container. The container allows application developers to integrate a program with all modules and components. In fact, without worrying about the settings and dependencies of an application on other platforms, run in any environment. So if you are programming, we definitely recommend using Docker.
In this article, we will be with you to learn how to run Docker Containers from the Windows Server 2019 training series. You can Choose your perfect Windows VPS Server Packages from eldernode.
How to run Docker Containers on Windows Server 2019
1) In the first step, you need to open PowerShell with Administrator access. To install Docker-Microsoft PackageManagement Provider from PowerShell Gallery, type the following command.
Install-Module -Name DockerMsftProvider -Repository PSGallery -Force
2) Install the latest Docker Engine and Client by running the command:
Install-Package -Name docker -ProviderName DockerMsftProvider
3) In the next step, agree to the installation using Y or A to Agree to all.
4) After the installation is complete, reboot the computer using the command below:
5) Use the following to check the installed docker version:
Administrator> Get-Package -Name Docker -ProviderName DockerMsftProvider Name Version Source ProviderName ---- ------- ------ ------------ docker 18.09.2 DockerDefault DockerMsftProvider
You can do the same with the docker –version command:
PS C:\Users\Administrator> docker version Client: Version: 18.09.2 API version: 1.39 Go version: go1.10.6 Git commit: 1ac774dfdd Built: unknown-buildtime OS/Arch: windows/amd64 Experimental: false error during connect: Get http://%2F%2F.%2Fpipe%2Fdocker_engine/v1.39/version: open //./pipe/docker_engine: The system cannot find the file specified. In the default daemon configuration on Windows, the docker client must be run elevated to connect. This error may also indicate that the docker daemon is not running.
6) You can update using the following commands:
Install-Package -Name Docker -ProviderName DockerMsftProvider -Update -Force Start-Service Docker
7) Run Docker Container
Type the following command to start Docker Daemon:
8) Now download the pre-created .NET sample image from the Docker Hub registry:
docker pull microsoft/dotnet-samples:dotnetapp-nanoserver-1809
9) By running a .Net Hello World application deploy a simple container:
docker run microsoft/dotnet-samples:dotnetapp-nanoserver-1809
Dear user, we hope you would enjoy this tutorial, you can ask questions about this training in the comments section, or to solve other problems in the field of Eldernode training, refer to the Ask page section and raise your problem in it as soon as possible. Make time for other users and experts to answer your questions.