zl程序教程

您现在的位置是:首页 >  系统

当前栏目

Docker问题——Docker安装报错 Containers Windows Feature is not available

DockerWindows安装 报错 not is available Feature
2023-09-11 14:20:02 时间

报错情况

Containers Windows Feature is not available
   在 CommunityInstaller.EnableFeaturesAction.GetFeaturesToEnable()
   在 CommunityInstaller.EnableFeaturesAction.<DoAsync>d__29.MoveNext()
--- 引发异常的上一位置中堆栈跟踪的末尾 ---
   在 System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   在 CommunityInstaller.InstallWorkflow.<HandleD4WPackageAsync>d__29.MoveNext()
--- 引发异常的上一位置中堆栈跟踪的末尾 ---
   在 System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   在 System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   在 CommunityInstaller.InstallWorkflow.<ProcessAsync>d__24.MoveNext()
   

解决方法:
把Hyper-V.bat文件内修改成

pushd "%~dp0"
dir /b %SystemRoot%\servicing\Packages\*containers*.mum >containers.txt
for /f %%i in ('findstr /i . containers.txt 2^>nul') do dism /online /norestart /add-package:"%SystemRoot%\servicing\Packages\%%i"
del containers.txt
Dism /online /enable-feature /featurename:Containers -All /LimitAccess /ALL
pause

管理员运行,重启安装即可。
注:有的教程里没有加pause导致报错