- Learning Windows Server Containers
- Srikanth Machiraju
- 508字
- 2021-07-02 23:23:25
Containers on Windows 10
The following steps explain how to set up a dev/test environment on Windows 10 for learning container development using Hyper-V Containers. Before continuing further, ensure that you're running Windows 10 Professional/Enterprise version with Anniversary update. For validating Windows Edition on Windows 10, click Start and type This PC, and then right-click on This PC and click on Properties. Check the Windows Edition section for the Windows 10 edition. If your PC shows Windows 10 Enterprise or Professional, you can download and install the Anniversary update from here (https://support.microsoft.com/en-us/help/12387/windows-10-update-history).
If you do not have any of the above, please proceed to the following section, which explains how to work with containers using the Windows Server 2016 environment on Azure and on-premises. Follow these steps to configure Hyper-V Containers on Windows 10:
- Click on Start menu and type powershell. Right-click Windows PowerShell and click on Run as administrator.
- Run the following command to install the containers feature on Windows 10:
Enable-WindowsOptionalFeature -Online -FeatureName containers -All
The preceding command gives the following output:

- Run the following command to install the Hyper-V Containers feature on Windows 10. We will only be using Windows Server Containers in this chapter; we will learn about working with Hyper-V Containers in following chapters:
Enable-WindowsOptionalFeature -Online -FeatureName
Microsoft-Hyper-V -All
- Restart the PC by running the following command:
Restart-Computer -Force
- Run the following command to update the registry settings:
Set-ItemProperty -Path 'HKLM:SOFTWARE\Microsoft\Windows
NT\CurrentVersion\Virtualization\Containers'
-Name VSmbDisableOplocks -Type DWord -Value 1 -Force
- Although PowerShell can be used to manage and run containers, Docker commands give a full wealth of options for container management. Microsoft PowerShell support for Windows Container development is still a work in progress, so we will mix and match PowerShell and Docker as per the scenarios.
Run the following set of steps one by one to install and configure Docker on Windows 10:
Invoke-WebRequest "https://master.dockerproject.org/windows/
amd64/docker-1.13.0-dev.zip" -OutFile "$env:TEMP\docker-1.13.0
-dev.zip"
-UseBasicParsing
Expand-Archive -Path "$env:TEMP\docker-1.13.0-dev.zip"
-DestinationPath $env:ProgramFiles
$env:path += ";c:\program files\docker"
[Environment]::SetEnvironmentVariable("Path", $env:Path + ";
C:\Program Files\Docker", [EnvironmentVariableTarget]::Machine)
dockerd --register-service
- Start the Docker Service by running the following command:
Start-Service docker
- In order to develop Windows Server Containers, we need any Windows base OS image, such as windowsservercore or nanoserver. Since Windows 10 supports Nano Servers only, run the following command to download the nanoservercore base OS image (we have a dedicated chapter for learning development using Nano Server images). The following command might take some time depending on your bandwidth; it downloads and extracts the nanoserver base OS image, which is 970 MB in size, approximately:
docker pull microsoft/nanoserver
At the time of writing, Windows 10 can only run Nano Server images. Even though the windowsservercore image gets downloaded successfully, running containers using this image will fail due to incompatibility with the OS.
- Ensure that the images are successfully downloaded by running the following command:
docker images
The preceding command gives the following output:

Now you are ready to start container development on Windows 10, you can directly skip to the Windows Server Containers development section to start creating Windows Containers.
- Learn Helm
- Installing and Configuring Windows 10:70-698 Exam Guide
- 嵌入式Linux驅(qū)動程序和系統(tǒng)開發(fā)實(shí)例精講
- Mastering Reactive JavaScript
- Ceph分布式存儲實(shí)戰(zhàn)
- Linux內(nèi)核設(shè)計(jì)的藝術(shù):圖解Linux操作系統(tǒng)架構(gòu)設(shè)計(jì)與實(shí)現(xiàn)原理
- iOS 8開發(fā)指南
- Windows 7實(shí)戰(zhàn)從入門到精通
- Building Telephony Systems With Asterisk
- Linux軟件管理平臺設(shè)計(jì)與實(shí)現(xiàn)
- μC/OS-III內(nèi)核實(shí)現(xiàn)與應(yīng)用開發(fā)實(shí)戰(zhàn)指南:基于STM32
- 鴻蒙HarmonyOS手機(jī)應(yīng)用開發(fā)實(shí)戰(zhàn)
- Linux系統(tǒng)安全:縱深防御、安全掃描與入侵檢測
- 電腦辦公(Windows 7 + Office 2013)入門與提高
- Serverless Architectures with Kubernetes