Installing Docker on windows 10 Home, can it be do

2019-04-17 16:34发布

问题:

Docker requires win 10 pro because it needs some virtualization extensions (HyperV and Containers). Can these requirements be fulfilled on win 10 Home?

回答1:

Yes, it can be done on Windows 10 Home (tried on win10Home v1809 27.01.2019)

Run in a command prompt as administrator:

  1. Install Hyper-V:

    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
    
  2. Install Containers:

    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
    
  3. Edit registry keys:

    REG ADD "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v EditionID /t REG_SZ /d "Professional"
    REG ADD "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v ProductName /t REG_SZ /d "Windows 10 Pro"
    
  4. Download and run official Docker Installer For Windows.

  5. In my case the registry keys were restored after restart, but you could restore them manually:

    REG ADD "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v EditionID /t REG_SZ /d "Core"
    REG ADD "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v ProductName /t REG_SZ /d "Windows 10 Home"