windows docker安裝

https://docs.microsoft.com/zh-cn/virtualization/windowscontainers/manage-docker/configure-docker-daemon

boot2docker 下載地址

https://github.com/boot2docker/boot2docker/releases

Docker-Machine 下載地址

http://github.com/docker/machine/releases

配置項(xiàng)
C:\ProgramData\docker\config

https://docs.microsoft.com/zh-cn/virtualization/windowscontainers/manage-docker/configure-docker-daemon

--設(shè)置配置
sc config docker binpath= ""C:\Program Files\docker\dockerd.exe" --run-service -H tcp://0.0.0.0:2375"

sc config docker binpath= ""C:\Program Files\docker\dockerd.exe" --data-root "F:\SoftTool\Docker\data-root"

sc config docker binpath= ""C:\Program Files\docker\dockerd.exe" --experimental true

windows 安裝docker 安裝說(shuō)明 使用 virtualbox 虛擬機(jī)
https://www.cnblogs.com/52fhy/p/8413029.html
默認(rèn)用戶名是docker,密碼tcuser

安裝說(shuō)明 hyperv-virtual-switch
https://www.linuxidc.com/Linux/2017-02/141062.htm

1、登錄到 虛擬機(jī)的docker環(huán)境

cmd cd到 docker-machine 目錄下
docker-machine ssh vm8
powerShell 環(huán)境
登錄到docker虛擬機(jī)環(huán)境 PS F:\SoftTool\Docker\docker-machine\v0.16.2>.\docker-machine ssh vm8

2、共享目錄 F:\SoftTool\Docker\data-root 到容器虛擬機(jī)中

docker run -it -v F:\SoftTool\Docker\data-root :\test alpine sh

創(chuàng)建Docker machine
在管理員cmd環(huán)境里進(jìn)入到docker-machine.exe所在的文件夾
運(yùn)行命令的格式如下:
docker-machine create -d hyperv --hyperv-virtual-switch "<NameOfVirtualSwitch>" <nameOfNode>

安裝命令
docker-machine create -d hyperv --hyperv-virtual-switch "DockNAT" VM8
把當(dāng)前主機(jī)設(shè)置為默認(rèn)docker命令運(yùn)行的主機(jī),根據(jù)提示,我們運(yùn)行下面命令

docker-machine.exe env VM8
運(yùn)行命令: @FOR /f "tokens=*" %i IN ('docker-machine env vm8') DO @%i

完成后,運(yùn)行命令: docker version 查看主機(jī)信息

重新生成我的證書命令:
docker-machine regenerate-certs VM8 --VM8虛擬機(jī)名稱

主機(jī)重啟ip地址修改后
錯(cuò)誤提示 :
error during connect: Get http://%2F%2F.%2Fpipe%2Fdocker_engine/v1.39/version: 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.
(連接期間出錯(cuò):獲取http://%2F%2F.%2Fpipe%2Fdocker_engine/v1.39/version:打開//.//pipe/docker_engine:系統(tǒng)找不到指定的文件。 在Windows上的默認(rèn)守護(hù)程序配置中,必須將docker客戶端提升運(yùn)行以進(jìn)行連接。 該錯(cuò)誤也可能表明docker守護(hù)程序未運(yùn)行)

解決辦法:
跳轉(zhuǎn)到 docker-machine.exe目錄下 cd F:\SoftTool\Docker\docker-machine\v0.16.2
輸入命令 docker-machine env VM8
錯(cuò)誤提示:
Error checking TLS connection: Error checking and/or regenerating the certs: There was an error validating certificates for host "192.168.10.194:2376": x509: certificate is valid for 192.168.8.110, not 192.168.10.194
You can attempt to regenerate them using 'docker-machine regenerate-certs [name]'.
Be advised that this will trigger a Docker daemon restart which might stop running containers.
(檢查TLS連接時(shí)出錯(cuò):檢查和/或重新生成證書時(shí)出錯(cuò):驗(yàn)證主機(jī)“ 192.168.10.194:2376”的證書時(shí)出錯(cuò):x509:證書對(duì)192.168.8.110有效,而不對(duì)192.168.10.194有效
您可以嘗試使用“ docker-machine regenerate-certs [name]”來(lái)重新生成它們。)

重新生成證書命令: F:\SoftTool\Docker\docker-machine\v0.16.2>docker-machine regenerate-certs VM8

Regenerate TLS machine certs? Warning: this is irreversible. (y/n): y
Regenerating TLS certificates
Waiting for SSH to be available...
Detecting the provisioner...
Copying certs to the local machine directory...
Copying certs to the remote machine...
Setting Docker configuration on the remote daemon...

選擇y
正常會(huì) 重新生成證書

輸入命令 docker version 查看 正常顯示

?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。