Get started: Prep Windows for containers
This tutorial describes how to:
- Set up Windows 10 or Windows Server for containers
- Run your first container image
- Containerize a simple .NET core application
To run containers on Windows Server, you need a physical server or virtual machine running Windows Server (Semi-Annual Channel), Windows Server 2019, or Windows Server 2016.
The first step is to install Docker, which is required for working with Windows containers. Docker provides a standard runtime environment for containers, with a common API and command-line interface (CLI).
For more configuration details, see Docker Engine on Windows.
To install Docker on Windows Server, you can use a OneGet provider PowerShell module published by Microsoft called the DockerMicrosoftProvider. This provider enables the containers feature in Windows and installs the Docker engine and client. Here's how:
Open an elevated PowerShell session and install the Docker-Microsoft PackageManagement Provider from the PowerShell Gallery.
Install-Module -Name DockerMsftProvider -Repository PSGallery -Force
If you're prompted to install the NuGet provider, type
Yto install it as well.
Use the PackageManagement PowerShell module to install the latest version of Docker.
Install-Package -Name docker -ProviderName DockerMsftProvider
When PowerShell asks you whether to trust the package source 'DockerDefault', type
Ato continue the installation.
After the installation completes, restart the computer.
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, followed by
Now that your environment has been configured correctly, follow the link to learn how to run a container.
Läser in feedback...