Windows Server 2019 容器化探索-Docker安装
2021-06-08 05:04
标签:rsh amd kernal 14.3 安装 服务 msf com summary 微软自Windows Server 2016开始支持Docker,今天我们将介绍在Windows Server 2019上安装并使用Docker容器。 通过 安装Docker 启用Docker Linux Container Support ==目前基于Windows Container只能运行Windows应用程序。== 在Docker使用 Linux Container时,仍然需要使用Linux kernal。 现在我们即可使用 Windows Container或者Linux Container,但是由于目前基于Windows Container只能运行Windows应用程序,所以我们需要使用 Windows Server 2019 容器化探索-Docker安装 标签:rsh amd kernal 14.3 安装 服务 msf com summary 原文地址:https://www.cnblogs.com/yankliu-vip/p/Docker-on-Windows-Server-2019.htmlDocker on Windows Server 2019
Install Docker EE on windows server 2019
Install-WindowsFeature -Name Hyper-V,Containers -IncludeAllSubFeature -IncludeManagementTools
Install-Module DockerMSFTProvider
Import-Module -Name DockerMSFTProvider -Force
Import-Packageprovider -Name DockerMSFTProvider -Force
Find-Package docker
确认是否安装成功
PS C:\Users\Administrator> Find-Package docker
Name Version Source Summary
---- ------- ------ -------
Docker 1.3.2 PSGallery This module helps with development using Docker on localhost. It ...
Docker 18.09.5 DockerDefault Contains Docker EE for use with Windows Server.
Install-Package -Name Docker -Source DockerDefault
# Set LCOW_SUPPORTED Variable to 1 for enabled
[Environment]::SetEnvironmentVariable("LCOW_SUPPORTED", "1", "Machine")
# Enable Experimental Features in Dockerd daemon.conf
$configfile = @"
{
"experimental": true
}
"@
$configfile|Out-File -FilePath C:\ProgramData\docker\config\daemon.json -Encoding ascii -Force
You should use the latest LCOW release hereInvoke-WebRequest -Uri "https://github.com/linuxkit/lcow/releases/download/v4.14.35-v0.3.9/release.zip" -UseBasicParsing -OutFile release.zip
Expand-Archive release.zip -DestinationPath "$Env:ProgramFiles\Linux Containers\."
Redis on Docker Linux Container
--platform
选择一种容器类型,参考如下
docker run --platform=linux --name redis-server -d -p 6379:6379 --restart=always redis
References
,How to Run ?? Linux Containers on Windows Server 2019
下一篇:c# Split
文章标题:Windows Server 2019 容器化探索-Docker安装
文章链接:http://soscw.com/index.php/essay/92072.html