在Windows上使用脚本安装Docker

时间:2017-01-04 19:29:41

标签: windows docker install

我尝试创建/查找在Windows上下载和安装docker的脚本。 这已经存在或者不可能吗?

2 个答案:

答案 0 :(得分:1)

以下是我在Windows 10上安装Docker CE的步骤。带有Powershell命令的示例。

# First Download the installer (wget is slow...)
# wget https://download.docker.com/win/stable/Docker%20for%20Windows%20Installer.exe -OutFile docker-installer.exe

(New-Object System.Net.WebClient).DownloadFile('https://download.docker.com/win/stable/Docker%20for%20Windows%20Installer.exe', 'docker-installer.exe')

# Install
start-process -wait docker-installer.exe " install --quiet"

# Clean-up
rm docker-installer.exe

# Run
start-process "$env:ProgramFiles\docker\Docker\Docker for Windows.exe"

write-host "Done."

答案 1 :(得分:0)

在Windows Server 2016上安装Docker Engine是两个命令,脚本简单:

Install-Module -Name DockerMsftProvider -Repository PSGallery -Force
Install-Package -Name docker -ProviderName DockerMsftProvider