Docker for Windows: Difference between revisions

From Wildsong
Jump to navigationJump to search
Brian Wilson (talk | contribs)
Brian Wilson (talk | contribs)
mNo edit summary
Line 1: Line 1:
Refer to the book from Packt, ''Docker on Windows, Second Edition''
Refer to the book from Packt, ''Docker on Windows, Second Edition'' by Elton Stoneman


https://docs.docker.com/docker-for-windows/
https://docs.docker.com/docker-for-windows/

Revision as of 17:25, 8 October 2019

Refer to the book from Packt, Docker on Windows, Second Edition by Elton Stoneman

https://docs.docker.com/docker-for-windows/


Workflow anticipated

  • Develop on Windows 10
  • Move container to Windows Server 2019

Windows 10

Download and install Docker Desktop for Windows. (Be prepared; this requires a logout and a reboot!)

Try Docker Desktop for Windows Tick the box "Use Windows containers instead of Linux containers (this can be changed after installation)".

This installs Kitematic, which runs as a service (lower right corner look for the Docker whale)

In Kitematic, turn on experimental features under Settings->Daemon. This worksaround a glitch, which manifests on builds as "no matching manifest for windows/amd64 10.0.18362 in the manifest list entries"

First things first in a bash shell I try

winpty docker run -it --rm hello-world

and it works, suggesting that I try this

winpty docker run -it mcr.microsoft.com/windows/servercore powershell

which failed with

C:/Program Files/Docker/Docker/Resources/bin/docker.exe: Error response from daemon: manifest
for mcr.microsoft.com/windows/servercore:latest not found: manifest unknown: manifest unknown.
See 'C:/Program Files/Docker/Docker/Resources/bin/docker.exe run --help'.

but adding the 1903 tag worked (after downloading the big bulky (about 2GB) servercore images (it's from Microsoft so it has to be big))

winpty docker run -it mcr.microsoft.com/windows/servercore:1903 powershell
.
.
Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.

Try the new cross-platform PowerShell https://aka.ms/pscore6

PS C:\> 

Awesome progress! Woot!

Note on running Linux containers on Windows

If you run a Linux container on a Windows machine you will be running a Linux virtual machine to host the Docker container(s) and that will be a heavier load on the server and also have resource limits (in particular, RAM will be capped by the Linux VM).

You can switch anytime if you for example want to run a test locally before deploying to a Linux server. In Kitematic it's an option "Switch to Linux containers..."

Windows Server 2019

Not there yet... come back later today.