Windows Server 2019 - Docker Daemon
Installing Docker via OneGet Provider PowerShell Module
Windows containers enable packaging applications with dependencies and leveraging operating system-level virtualization for fast, isolated environments. Here’s how to install Docker using the OneGet provider PowerShell module:
-
Install the OneGet PowerShell module:
Install-Module -Name DockerMsftProvider -Repository PSGallery -Force
-
Use OneGet to install the latest version of Docker:
Install-Package -Name docker -ProviderName DockerMsftProvider
-
After installation, reboot the computer:
Restart-Computer -Force
Downloading Docker Manually
For environments with restricted internet access, follow these steps to manually download and install Docker Engine - Enterprise:
-
Download the Docker installer archive on a machine with internet access:
Invoke-WebRequest -UseBasicParsing -OutFile docker-19.03.3.zip https://download.docker.com/components/engine/windows-server/19.03/docker-19.03.3.zip
-
Extract the archive, register, and start the Docker service:
# Stop Docker service if an earlier version is installed 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 Restart-Computer -Force # 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
-
Test your Docker EE installation by running the hello-world container:
docker pull hello-world:nanoserver docker images docker container run hello-world:nanoserver
This guide covers both automated installation via OneGet and manual installation for environments with restricted internet access.