win10 家庭版安装Docker
- 1. 开启Hyper-V
- 2. 伪装成win10专业版
- 3. 下载Docker for Windows
- docker for windows could not read CA certificate问题
- error during connect: Get http://%2F%2F.%2Fpipe%2Fdocker_engine/v1.39/containers/json: open //./pipe/docker_engine: The system cannot find the file specified. In the default daemon configuration on Windows, the docker client must be run elevated to connect. This error may also indicate that the docker daemon is not running
1. 开启Hyper-V
- 新建hyperv.cmd文件,输入内容如下并保存:
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
- 右击该文件以管理员身份执行hyperv.cmd文件。如果系统要你重启,便重启。
- 在控制面板->程序和功能->启用或关闭Windows功能打开Hyper-V。
2. 伪装成win10专业版
以管理员身份打开cmd。
执行如下命令:
REG ADD "HKEY_LOCAL_MACHINE\software\Microsoft\Windows NT\CurrentVersion" /v EditionId /T REG_EXPAND_SZ /d Professional /F
3. 下载Docker for Windows
下载地址:https://download.docker.com/win/stable/Docker%20for%20Windows%20Installer.exe
官网下载链接(需FQ): https://store.docker.com/editions/community/docker-ce-desktop-windows
国内镜像:
https://oomake.com/download/docker-windows (百度网盘)
https://mirrors.ustc.edu.cn/docker-ce/ (版本更新不及时)
下载后直接安装,安装时注意取消勾选window容器(默认不会勾选)。
Docker安装成功后,执行cmd命令。
docker version
docker for windows could not read CA certificate问题
问题原因:
之前安装过 docker toolbox。
解决步骤:
- 删掉四个docker 的环境变量
- 执行cmd命令
docker-machine rm default
- 以管理员身份执行cmd命令
@FOR /f "tokens=*" %i IN ('docker-machine env -u') DO @%i
error during connect: Get http://%2F%2F.%2Fpipe%2Fdocker_engine/v1.39/containers/json: open //./pipe/docker_engine: The system cannot find the file specified. In the default daemon configuration on Windows, the docker client must be run elevated to connect. This error may also indicate that the docker daemon is not running
解决步骤:
- 首先检查docker是否启动
- 如果docker已经启动还报error during connect: Get http://%2F%2F.%2Fpipe%2Fdocker_engine/v1.39/containers/json: open //./pipe/docker_engine: The system cannot find the file specified. In the default daemon configuration on Windows, the docker client must be run elevated to connect. This error may also indicate that the docker daemon is not running 错误。管理员启动cmd运行如下命令:
docker-machine env --shell cmd default //或者 docker-machine env default