windows server 离线安装docker

2019-04-01  本文已影响0人  shangyaqi
  1. download docker.zip
    Invoke-WebRequest -UseBasicParsing -OutFile docker-19.03.3.zip https://download.docker.com/components/engine/windows-server/19.03/docker-19.03.3.zip

  2. install docker on windows server

Stop Docker service

Stop-Service docker

Extract the archive.

Expand-Archive docker-19.03.3.zip -DestinationPath $Env:ProgramFiles -Force

Clean up the zip file.

Remove-Item -Force docker-19.03.3.zip

Install Docker. This requires rebooting.

$null = Install-WindowsFeature containers

Add Docker to the path for the current session.

env:path += ";env:ProgramFiles\docker"

Optionally, modify PATH to persist across sessions.

newPath = "env:ProgramFiles\docker;" +
[Environment]::GetEnvironmentVariable("PATH",
[EnvironmentVariableTarget]::Machine)

[Environment]::SetEnvironmentVariable("PATH", $newPath,
[EnvironmentVariableTarget]::Machine)

Register the Docker daemon as a service.

dockerd --register-service

Start the Docker service.

Start-Service docker

上一篇下一篇

猜你喜欢

热点阅读