Docker Enterprise Edition for Windows Server 2016(Docker EE)在Windows Server 2016上啟用本機Docker容器。Docker EE安裝包包括在Windows Server 2016上運行Docker所需的所有內容。本主題介紹了預安裝注意事項,以及如何下載和安裝Docker EE
## 安裝Docker EE
Docker EE for Windows需要Windows Server 2016。要在Windows 10機器上安裝Docker Community Edition(Docker CE)。
1. 打開PowerShell命令提示符,然后鍵入以下命令。
~~~
PS> Install-Module -Name DockerMsftProvider -Force
PS> Install-Package -Name docker -ProviderName DockerMsftProvider -Force
PS> Restart-Computer -Force
~~~
2. 通過運行`hello-world`容器測試Docker EE 安裝。
~~~
PS> docker run hello-world:nanoserver
Unable to find image 'hello-world:nanoserver' locally
nanoserver: Pulling from library/hello-world
bce2fbc256ea: Pull complete
3ac17e2e6106: Pull complete
8cac44e17f16: Pull complete
5e160e4d8db3: Pull complete
Digest: sha256:25eac12ba40f7591969085ab3fb9772e8a4307553c14ea72d0e6f98b2c8ced9d
Status: Downloaded newer image for hello-world:nanoserver
Hello from Docker!
This message shows that your installation appears to be working correctly.
<snip>
~~~
## 使用腳本來安裝Docker EE
當您要手動安裝腳本自動安裝或安裝在空中密碼系統上時,請使用以下步驟。
1. 在PowerShell命令提示符下,在具有連接的計算機上下載安裝程序歸檔。
~~~
# On an online machine, download the zip file.
PS> invoke-webrequest -UseBasicparsing -Outfile docker.zip https://download.docker.com/components/engine/windows-server/17.03/docker-17.03.0-ee.zip
~~~
2. 將zip文件復制到要安裝Docker的機器上。在PowerShell命令提示符下,使用以下命令提取歸檔,注冊和啟動Docker服務。
~~~
# Extract the archive.
PS> Expand-Archive docker.zip -DestinationPath $Env:ProgramFiles
# Clean up the zip file.
PS> Remove-Item -Force docker.zip
# Install Docker. This will require rebooting.
$null = Install-WindowsFeature containers
# Add Docker to the path for the current session.
PS> $env:path += "$env:ProgramFiles\docker"
# Optionally, modify PATH to persist across sessions.
PS> $newPath = "$env:ProgramFiles\docker;" +
[Environment]::GetEnvironmentVariable("PATH",
[EnvironmentVariableTarget]::Machine)
PS> [Environment]::SetEnvironmentVariable("PATH", $newPath,
[EnvironmentVariableTarget]::Machine)
# Register the Docker daemon as a service.
PS> dockerd --register-service
# Start the daemon.
PS> Start-Service docker
~~~
3. 通過運行`hello-world`容器測試Docker EE 安裝。
~~~
PS> docker run hello-world:nanoserver
~~~
###安裝前要知道什么
* Docker EE for Windows安裝包括:安裝提供了Docker Engine和 Docker CLI客戶端。