Docker for Windows: Difference between revisions

From Wildsong
Jump to navigationJump to search
Brian Wilson (talk | contribs)
mNo edit summary
Brian Wilson (talk | contribs)
Line 38: Line 38:


  winpty docker run -it mcr.microsoft.com/windows/servercore:1903 powershell
  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:\>


=== Note on Linux containers ===
Awesome progress! Woot!
As I understand it if you run a Linux container on a Windows machine you will really be running a Linux virtual machine to host the Docker containers
 
and that seems to imply it will be a heavier load on the server and probably also have strict resource limits (in particular, RAM will be capped by the
=== Note on running Linux containers on Windows ===
Linux VM). I am guessing it would have to install WSL (Windows System for Linux) or VirtualBox too.
 
As I understand it if you run a Linux container on a Windows machine you will really be running a Linux virtual machine to host the Docker containers and that seems to imply it will be a heavier load on the server and probably also have strict resource limits (in particular, RAM will be capped by the Linux VM). I am guessing it would have to install WSL (Windows System for Linux) or VirtualBox too.


== Windows Server 2019 ==
== Windows Server 2019 ==


Not there yet... come back later today.
Not there yet... come back later today.

Revision as of 17:15, 8 October 2019

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

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

As I understand it if you run a Linux container on a Windows machine you will really be running a Linux virtual machine to host the Docker containers and that seems to imply it will be a heavier load on the server and probably also have strict resource limits (in particular, RAM will be capped by the Linux VM). I am guessing it would have to install WSL (Windows System for Linux) or VirtualBox too.

Windows Server 2019

Not there yet... come back later today.