简体   繁体   English

Windows 10 家庭版上的 Docker 安装问题

[英]Docker installation issues on Windows 10 Home Edition

I am facing problem while installing the Docker on my machine.在我的机器上安装 Docker 时遇到问题。 OS is Windows 10 Home Edition.操作系统为 Windows 10 家庭版。 I want to use Splash and that needs Docker.我想使用 Splash 并且需要 Docker。

在此处输入图片说明

First, check that your PC supports Hyper-V and you have Hyper-V enabled in BIOS.首先,检查您的 PC 是否支持 Hyper-V 并且您在 BIOS 中启用了 Hyper-V。 Windows Home does not allows to install some features/packages in GUI, but it's possible to add them from command line. Windows Home 不允许在 GUI 中安装某些功能/包,但可以从命令行添加它们。

Make a file hyperv.bat file and run is at Administrator:制作一个文件hyperv.bat文件并以管理员hyperv.bat运行:

@rem Install Hyper-V on Windows Home
pushd "%~dp0"
dir /b %SystemRoot%\servicing\Packages\*Hyper-V*.mum >hyper-v.txt
for /f %%i in ('findstr /i . hyper-v.txt 2^>nul') do dism /online /norestart /add-package:"%SystemRoot%\servicing\Packages\%%i"
del hyper-v.txt
Dism /online /enable-feature /featurename:Microsoft-Hyper-V -All /LimitAccess /ALL
pause

Reboot computer after that.之后重启电脑。 Then you need to trick the Docker installer to think you have Windows Pro: change your registry: HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion and change EditionID from Core to Professional .然后,您需要欺骗 Docker 安装程序以为您拥有 Windows Pro:更改您的注册表: HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion并将EditionIDCore更改为Professional

Instal Docker for Windows, change the registry back.安装适用于 Windows 的 Docker,将注册表改回。 And that's all.仅此而已。

See also https://xmedeko.blogspot.com/2019/04/running-docker-on-windows-10-home.html另见https://xmedeko.blogspot.com/2019/04/running-docker-on-windows-10-home.html

  1. Enable from BIOS从 BIOS 启用
  2. CPU virtualization is allowed only for 1 tool on Windows 10 Home. Windows 10 家庭版上仅允许 1 个工具使用 CPU 虚拟化。 So, remove any other virtualization tool.因此,删除任何其他虚拟化工具。 So, uncheck even Windows Hypervisor Platform in 'Turn Windows features on and off'因此,在“打开和关闭 Windows 功能”中甚至取消选中 Windows 管理程序平台
  3. Disable Credential Guard as per https://docs.microsoft.com/en-us/windows/security/identity-protection/credential-guard/credential-guard-manage This doesn't happens when the credential helper is run in 'Administrative mode', reason being that running scripts is disabled, we need to enable it So, as per https://winaero.com/blog/change-powershell-execution-policy-windows-10/ Open 'Command Prompt' in 'Administrator' mode and type -根据https://docs.microsoft.com/en-us/windows/security/identity-protection/credential-guard/credential-guard-manage禁用凭据保护当凭据助手在“管理”中运行时不会发生这种情况模式”,原因是运行脚本被禁用,我们需要启用它所以,根据https://winaero.com/blog/change-powershell-execution-policy-windows-10/在“管理员”中打开“命令提示符” ' 模式和类型 -

     cd C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\ C:\\Windows\\System32\\WindowsPowerShell\\v1.0>Powershell.exe -ExecutionPolicy Unrestricted -File E:\\software\\dgreadiness_v3.6\\DG_Readiness_Tool_v3.6.ps1 -Disable -AutoReboot

    After this, the system reboots and credential guard is disabled在此之后,系统重新启动并禁用凭据保护

I was able to install Docker on Windows 10 home edition by installing legacy Docker software called Docker toolbox and enabling the virtualization in my systems BIOS.通过安装名为 Docker 工具箱的传统 Docker 软件并在我的系统 BIOS 中启用虚拟化,我能够在 Windows 10 家庭版上安装 Docker。 Check this to follow the procedure: Installing Docker on Windows 10 home successfully How to enable virtualization in your systems选中此项以遵循以下步骤: 在 Windows 10 家庭版上成功安装 Docker 如何在您的系统中启用虚拟化

If you don't want to go the Hyper-V way you can use Docker with WSL2(Windows Subsystem for Linux) for Windows 10 Home.如果您不想采用 Hyper-V 方式,您可以将 Docker 与 WSL2(适用于 Linux 的 Windows 子系统)一起用于 Windows 10 Home。

  1. Go to Settings -> Update&Security -> Windows Insider Program and enroll for the 'Slow' track of windows insider.转至设置 -> 更新和安全 -> Windows Insider Program 并注册 windows Insider 的“慢”轨道。

  2. Enable WSL from instructions given here https://docs.microsoft.com/en-us/windows/wsl/install-win10根据此处给出的说明启用 WSL https://docs.microsoft.com/en-us/windows/wsl/install-win10

  3. Upgrade to WSL2 from here https://docs.microsoft.com/en-us/windows/wsl/wsl2-kernel从这里升级到 WSL2 https://docs.microsoft.com/en-us/windows/wsl/wsl2-kernel

  4. Download this version of Docker which supports WSL2 during installation itself : https://download.docker.com/win/stable/Docker%20Desktop%20Installer.exe下载这个在安装过程中支持 WSL2 的 Docker 版本: https ://download.docker.com/win/stable/Docker%20Desktop%20Installer.exe

  5. Check the boxes to use WSL2 instead of Hyper-V.选中复选框以使用 WSL2 而不是 Hyper-V。

If you install the latest Windows 20H1 update you can install Docker Desktop on Windows 10 Home.如果您安装最新的 Windows 20H1 更新,则可以在 Windows 10 Home 上安装 Docker Desktop。

cf https://www.codingnagger.com/2020/06/20/install-docker-desktop-on-windows-10/参见https://www.codingnagger.com/2020/06/20/install-docker-desktop-on-windows-10/

Docker for Windows is available for Docker for Windows 可用于

  1. Windows 10 64-bit professional and Windows 10 64 位专业版和

  2. BIOS-enable virtualization BIOS 启用虚拟化

To run Docker, your machine must have a 64-bit operating system running Windows 7 or higher.要运行 Docker,您的机器必须具有运行 Windows 7 或更高版本的 64 位操作系统。

The home edition of Win 10 does not support virtualization but you can enable. Win 10 家庭版不支持虚拟化,但您可以启用。

  1. Click on the link https://www.itechtics.com/?dl_id=80 and download the batch file that enables the Hyper-V on Windows 10 Home.单击链接https://www.itechtics.com/?dl_id=80并下载在 Windows 10 Home 上启用 Hyper-V 的批处理文件。
  2. Next, right-click on the batch file and select “Run as Administrator“.接下来,右键单击批处理文件并选择“以管理员身份运行”。 Keep in mind, you have to be connected to the Internet to enable this feature!请记住,您必须连接到 Internet 才能启用此功能!
  3. Once the installation is complete, RESTART your computer!安装完成后,重新启动计算机!
  4. A Windows Features window will open up.将打开 Windows 功能窗口。 Now, scroll down and enable all the checkboxes under Hyper-V, and hit the OK button.现在,向下滚动并启用 Hyper-V 下的所有复选框,然后点击 OK 按钮。
  5. Open the Start menu and search for “Hyper-V”.打开“开始”菜单并搜索“Hyper-V”。 If Hyper-V is not showing up in the search results, then open the Run dialog using the Win+R key combo.如果 Hyper-V 未显示在搜索结果中,请使用 Win+R 组合键打开“运行”对话框。 Now, enter virtmgmt.msc and hit Enter.现在,输入 virtmgmt.msc 并按 Enter。
  6. The Hyper-V Manager window should now appear. Hyper-V 管理器窗口现在应该出现。

Now that Hyper-V is enabled, you may start creating your first virtual machine (VM).现在 Hyper-V 已启用,您可以开始创建您的第一个虚拟机 (VM)。

Virtualization must be enabled. 必须启用虚拟化。

https://docs.docker.com/docker-for-windows/install/ https://docs.docker.com/docker-for-windows/install/

I enabled Virtualization in my BIOS settings. 我在BIOS设置中启用了虚拟化。 Then in Windows > Task Manager > Performance it displays "Virtualization: Enabled" 然后在Windows>任务管理器>性能中显示“虚拟化:已启用”

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM