Skip to content

mechdeveloper/WindowsServer2016_DockerEE

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Docker on Windows Server 2016

Official Microsoft Docs

Use a script to install Docker EE on Windows Server 2016

On an online machine, download the zip file

[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
Invoke-WebRequest -OutFile docker-19.03.12.zip https://dockermsft.azureedge.net/dockercontainer/docker-19-03-12.zip

If you need to download a specific Docker EE Engine release, all URLs can be found on this JSON index

https://dockermsft.blob.core.windows.net/dockercontainer/DockerMsftIndex.json

Stop Docker service if eralier version of Docker is already installed

Stop-Service docker

Extract the archive

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

Clean up the zip file

Remove-Item -Force docker-19.03.12.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

Pull base Windows images

docker pull mcr.microsoft.com/windows/servercore:ltsc2016
docker pull mcr.microsoft.com/windows/nanoserver:sac2016

Docker Commands

docker info
docker pull (from hub.docker.com)
docker images
docker run
docker ps
docker ps -a
docker stop
docker rm

docker run <image>
docker run --name=<customname> <image>
docker run --rm <image>
docker run -d <iamge>
docker run -d -it <image>
docker run -d -p <portOut(HOST)>:<portIn(Container)>

Build docker image

docker build -t <imagename> .

Run IIS container

docker run -d -p 9080:80 <imagename>
# get container ip
docker inspect -f '{{range.NetworkSettings.Networks}}{{.IPAddress}}{{end}}' <containerID>
Invoke-WebRequest http://<containerip>:9080 -usebasicparsing

Deploy as a docker stack

# initiate docker swarm
docker swarm init
docker stack deploy --compose-file docker-compose.yml test_iis_win2016

About

Docker Enterprise - Engine on Windows Server 2016

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors