首页 > 解决方案 > 无法在 AWS 上的 Windows Server 2019 上运行 Linux Docker 容器

问题描述

我在 AWS 上有一个 windows server 2019,我已经按照以下说明安装和设置了 Linux Docker Container。

Install-Module DockerMsftProvider -Force

Install-Package Docker -ProviderName DockerMsftProvider -Force

Restart-Computer

$configfile =@"
{
    "experimental":true
}
"@

$configfile|Out-File -FilePath c:\ProgramData\docker\config\daemon.json -Encoding ascii -Force

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

Invoke-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\."

Restart-Service Docker

但是,在运行任何 Linux 映像时出现以下错误:

    PS C:\Users\Administrator> docker run --rm -it --platform=linux ubuntu bash
docker: Error response from daemon: failed to start service utility VM (createreadwrite): hcsshim::CreateComputeSystem 4242d968c7830dd923c657267486ea32ae9d843c76041d3b4beb39146efc5ea2_svm: The virtual machine could not be started because a required feature is not installed.
(extra info: {"SystemType":"container","Name":"4242d968c7830dd923c657267486ea32ae9d843c76041d3b4beb39146efc5ea2_svm","Layers":null,"HvPartition":true,"HvRuntime":{"ImagePath":"C:\\Program Files\\Linux Containers","LinuxInitrdFile":"initrd.img","LinuxKernelFile":"kernel"},"ContainerType":"linux","TerminateOnLastHandleClosed":true}).
See 'docker run --help'.

此外,还启用了容器功能和 Hyper-V 角色。

这是 docker 版本信息。

在此处输入图像描述

我关注了大部分文章、博客,并在过去几个小时内使用了不同版本的 Docker EE(包括预览版),但无济于事。有没有人能够解决类似的问题?任何帮助表示赞赏。如果需要更多信息,请告诉我。

标签: docker

解决方案


推荐阅读