Docker requires win 10 pro because it needs some virtualization extensions (HyperV and Containers). Can these requirements be fulfilled on win 10 Home?
Yes, it can be done on Windows 10 Home (tried on win10Home v1809 27.01.2019)
Run in a command prompt as administrator :
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
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
Edit registry keys:
REG ADD "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion" /f /v EditionID /t REG_SZ /d "Professional" REG ADD "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion" /f /v ProductName /t REG_SZ /d "Windows 10 Pro"
Download and run official Docker Installer For Windows.
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"
There is now a better way to run Docker on Windows 10 Home edition.
The next version of Docker for Windows runs on WSL 2 and MS has made an exception for WSL 2, allowing it to use hyper-V even on Home editions of Windows 10.
My justification for calling this 'better' is that this is the future of Docker on Windows because Docker inc. feels that this is a considerably better solution, as they discuss in their announcements about this new version.
But if you want to take advantage of this solution now (pre-2019H2 Windows update) you will need to install an insiders edition of Windows in order to use the WSL 2 preview and then install the preview of the new Docker .
2020-07 Update
Windows 10, version 2004 is now GA so I thought I would add to this. The above still holds true, but here are some new resources...
https://arstechnica.com/gadgets/2020/06/whats-new-in-windows-10-build-2004/
And scroll down to 'Windows Subsystem for Linux, version 2' for a good short discussion.
And an updated link to the Docker install...
Install Docker Desktop Stable 2.3.0.2 (or later).
https://docs.docker.com/docker-for-windows/wsl/
This might help someone who cannot upgrade their system to pro or professional. Consider installing Docker Toolbox on Windows . For mac users: Docker Toolbox on Mac. Check out difference Here
Legacy desktop solution. Docker Toolbox is for older Mac and Windows systems that do not meet the requirements of 'Docker Desktop for Mac' and 'Docker Toolbox on Windows'. We recommend updating to the newer applications, if possible.
As per documentation , the toolbox includes these Docker tools:
docker-machine
commandsdocker
commandsdocker-compose
commandsIf you want to use Docker directly within Windows, and you want to run Windows containers, there's still no official support. Docker Desktop won't allow it; it says "Windows Containers support requires a Windows 10 Pro or enterprise build >= 14372".
However, if you're interested in Linux containers, and you have WSL2 on your Windows 10 Home instance (which you'll haveas of version 1903+ ), you don't need to install Docker Desktop.
Get into an elevated CLI prompt (CMD and PS both work fine):
wsl --status
wsl --install
wsl --install --distribution ubuntu
wsl --user root
followed by passwd {your-account-name}
to fix it.) sudo apt update && sudo apt upgrade
sudo apt install -y net-tools
If you want more info on how to control your instance(s), look at the Microsoft docs .
In general, getting "into" the default, Ubuntu instance within WSL is as easy as typing either "bash" or "ubuntu" from a regular CLI prompt. Though, I'd highly recommend installing "Windows Terminal" and using that instead.
Open up a prompt inside your Linux instance. The general instructions are here, if you need more help. I used a Ubuntu instance.
curl -fsSL https://download.docker.com/linux/${ID}/gpg | sudo apt-key add -
curl -fsSL https://download.docker.com/linux/${ID}/gpg | sudo apt-key add -
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
echo "deb [arch=$(dpkg --print-architecture)] https://download.docker.com/linux/${ID} $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list
echo "deb [arch=$(dpkg --print-architecture)] https://download.docker.com/linux/${ID} $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt update
sudo apt install -y docker-ce docker-ce-cli containerd.io
sudo usermod -aG docker $USER
wsl --terminate {distro-name}
. Then open up a new session.sudo -b dockerd
docker run --rm hello-world
WSL2 doesn't presently have a clean way to auto-start the dockerd daemon. There's a lot of workarounds on the 'Net. Some people start it via a Scheduled task that starts dockerd via wsl
. Some people start it via a smart chunk of code in either .profile
or .bashrc
. Soon, there's supposed to be a officially supported approach via the "[boot]" section of the /etc/wsl.conf file, but it still doesn't appear to have landed in Windows 10 20H2 as it was suggested it would . I'm probably going to go the .bashrc
route, but for now, I just manually start it.
/mnt/{windows-drive-letter}/...
\\\\wsl$\\{linux-instance-name}\\...
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.