赞
踩
1.打开PowerShell ,从 PowerShell 库安装 Docker-Microsoft PackageManagement
Install-Module -Name DockerMsftProvider -Repository PSGallery -Force
如果系统提示安装 NuGet 提供程序,还请键入 Y
进行安装
如果在打开 PowerShell 库时遇到错误,则可能需要将 PowerShell 客户端使用的 TLS 版本设置为 TLS 1.2。 为此,请运行以下命令:
- # Set the TLS version used by the PowerShell client to TLS 1.2.
- [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]::Tls12;
2.使用 PackageManagement PowerShell 模块安装最新版本的 Docker
Install-Package -Name docker -ProviderName DockerMsftProvider
PowerShell 询问是否信任包源“DockerDefault”时,键入 A
以继续进行安装。
3.重启系统
Restart-Computer -Force
4.docker 拉取镜像出现错误no matching manifest for windows/amd64 10.0.17763 in the manifest list entries
解决方式启用Linux容器支持
- # 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
重启docker 服务生效
5.运行docker 容器报错Error response from daemon: failed to start service utility VM (createreadwrite): kernel 'C:\Program Files\Linux Containers\kernel' not found.
解决方式安装 Linux 内核,我们需要部署 LCOW 才能让它运行
- 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\."
6.再次运行--platform=linux 容器报错Error response from daemon: failed to start service utility VM (createreadwrite): hcsshim::CreateComputeSystem 19873f303a3882e35523aa46ba31334baa669bdc5928b001900a9435a8a5468e_svm: The virtual machine could not be started because a required feature is not installed.
无法解决,最后已放弃 。。。。。。
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。