下載 windows server 2016 180天評估版本。git
地址:https://www.microsoft.com/en-us/evalcenter/evaluate-windows-server-2016?i=1github
更新,輸入sconfig,選擇6下載安裝更新。集羣服務須要更新KB4015217docker
=============================================================================== 服務器配置 =============================================================================== 1) 域/工做組: 工做組: WORKGROUP 2) 計算機名: WIN-4PPKR3FT6CV 3) 添加本地管理員 4) 配置遠程管理 已啓用 5) Windows 更新設置: 僅下載 6) 下載並安裝更新 7) 遠程桌面: 已啓用(全部客戶端) 8) 網絡設置 9) 日期和時間 10) 遙測設置基本 11) Windows 激活 12) 註銷用戶 13) 從新啓動服務器 14) 關閉服務器 15) 退出到命令行
首先安裝oneget PowerShell模塊shell
PS C:\Users\Administrator> Install-Module DockerProvider -Force
再使用oneget安裝最新版dockerwindows
PS C:\Users\Administrator> Install-Package Docker -ProviderName DockerProvider -Force Install-Package Docker -ProviderName DockerMsftProvider -Force Name Version Source Summary ---- ------- ------ ------- Docker 17.06.2-ee-6 Docker Docker for Windows Server 2016
安裝完成重啓計算機安全
Restart-Computer -Force
PS C:\Users\Administrator> docker version Client: Version: 17.06.2-ee-6 API version: 1.30 Go version: go1.8.3 Git commit: e75fdb8 Built: Mon Nov 27 22:46:09 2017 OS/Arch: windows/amd64 Server: Version: 17.06.2-ee-6 API version: 1.30 (minimum version 1.24) Go version: go1.8.3 Git commit: e75fdb8 Built: Mon Nov 27 22:55:16 2017 OS/Arch: windows/amd64 Experimental: false
docker container run hello-world:nanoserver
Invoke-WebRequest "https://github.com/docker/compose/releases/download/1.18.0/docker-compose-Windows-x86_64.exe" -UseBasicParsing -OutFile $Env:ProgramFiles\docker\docker-compose.exe
PS C:\Users\Administrator> docker-compose version docker-compose version 1.18.0, build 8dd22a96 docker-py version: 2.6.1 CPython version: 2.7.14 OpenSSL version: OpenSSL 1.0.2k 26 Jan 2017
docker image pull docker/ucp-agent-win:2.2.5 docker image pull docker/ucp-dsinfo-win:2.2.5
docker container run --rm docker/ucp-agent-win:2.2.5 windows-script | powershell -noprofile -noninteractive -command 'Invoke-Expression -Command $input' netsh advfirewall firewall add rule name="docker_local" dir=in action=allow protocol=TCP localport=2376 netsh advfirewall firewall add rule name="docker_proxy" dir=in action=allow protocol=TCP localport=12376
C:\ProgramData\docker\daemoncerts
docker container run --rm -v C:\ProgramData\docker\daemoncerts:C:\certs docker/ucp-agent-win:2.2.5 generate-certs
Stop-Service docker dockerd --unregister-service dockerd -H npipe:// -H 0.0.0.0:2376 --tlsverify --tlscacert=C:\ProgramData\docker\daemoncerts\ca.pem --tlscert=C:\ProgramData\docker\daemoncerts\cert.pem --tlskey=C:\ProgramData\docker\daemoncerts\key.pem --register-service Start-Service docker