项目场景:【Docker】 Windows10运行Windows镜像常见错误
很多项目要求在Windows系统下运行,但开发环境的安装相对复杂,并且难以重新配置到新设备,甚至会出现多个项目的运行环境相互冲突和干扰的情况,这时候配置好一个镜像后就可以一劳永逸解决很多问题,直接用docker拉取Windows镜像即可。
问题描述
pull Windows镜像时候出现**“image operating system “windows” cannot be used on this platform”**错误
docker pull xyzrobotics/win10:devel-test
原因分析
# 查看客户(本地)机器和服务机器的系统版本
docker version
客户机的系统是windows,服务器的系统是linux,俩者不一致导致出错。
解决方案
右下角右键点击docker Desktop–>选择Swith to Windows containers
客户机的系统和服务器的系统都是Windows,俩者保持一致。
问题描述
Swith to Windows containers时候出现**“Containers feature is disabled. Enable it using the PowerShell script (in an administrative PowerShe…”**错误
解决办法
管理员身份运行"命令提示符"或者Windows PowerShell,执行上述错误给出提示命令。
Enable-WindowsOptionalFeature -Online -FeatureName $("Microsoft-Hyper-V", "Containers") -All
重启电脑即可。