How do you run a Linux Docker container on Windows Server 2016?

I get:

PS C:\tmp> docker pull ubuntu
Using default tag: latest
latest: Pulling from library/ubuntu
no matching manifest for windows/amd64 in the manifest list entries

Now, before you say 'Duplicate!', 'make sure it's in experimental mode', like all the other answers to this question out there, I have.

I have followed the instructions on LinuxKit based LCOW images, and even read and followed the steps to manually create a hyper-v images from Run Linux containers on Windows.

I have downloaded the nightly build of Docker.

I am running in experimental mode:

PS C:\tmp> docker version
Client:
 Version:       master-dockerproject-2018-02-01
 API version:   1.36
 Go version:    go1.9.3
 Git commit:    26a2a459
 Built: Thu Feb  1 23:50:28 2018
 OS/Arch:       windows/amd64
 Experimental:  false
 Orchestrator:  swarm

Server:
 Engine:
  Version:      master-dockerproject-2018-02-01
  API version:  1.36 (minimum version 1.24)
  Go version:   go1.9.3
  Git commit:   53a58da
  Built:        Thu Feb  1 23:57:33 2018
  OS/Arch:      windows/amd64
  Experimental: true

I have tried with the --platform argument:

PS C:\tmp> docker run --platform linux ubuntu
Unable to find image 'ubuntu:latest' locally
C:\Program Files\Docker\docker.exe: Error response from daemon: invalid platform: invalid platform os "linux".
See 'C:\Program Files\Docker\docker.exe run --help'.

I seem to have some differences to the docker info from my Windows 10 desktop machine, where everything is working:

Containers: 0
 Running: 0
 Paused: 0
 Stopped: 0
Images: 0
Server Version: master-dockerproject-2018-02-01
Storage Driver: windowsfilter
 Windows:
Logging Driver: json-file
Plugins:
 Volume: local
 Network: ics l2bridge l2tunnel nat null overlay transparent
 Log: awslogs etwlogs fluentd gelf json-file logentries splunk syslog
Swarm: inactive
Default Isolation: process

# Windows 10 value:
# Kernel Version: 4.9.60-linuxkit-aufs
Kernel Version: 10.0 14393 (14393.2007.amd64fre.rs1_release.171231-1800)

# Windows 10 values:
# Operating System: Docker for Windows
# OSType: linux
Operating System: Windows Server 2016 Standard
OSType: windows

Architecture: x86_64
CPUs: 2
Total Memory: 3.997GiB
Name: Tests
ID: ...
Docker Root Dir: C:\lcow
Debug Mode (client): false
Debug Mode (server): true
 File Descriptors: -1
 Goroutines: 16
 System Time: 2018-02-02T14:46:53.5608784+08:00
 EventsListeners: 0
Registry: https://index.docker.io/v1/
Labels:
Experimental: true
Insecure Registries:
 127.0.0.0/8
Live Restore Enabled: false

So the version on the Windows server is not configured to Linux containers.

How do I change that configuration to the correct one?

On Docker for windows you can conveniently right click on the icon in the task bar and pick Switch to Linux containers.

How can you do whatever it is that that does, on Windows Server?

It seems you are not running on Windows Server, version 1709. Your Windows kernel version is

Kernel Version: 10.0 14393 (14393.2007.amd64fre.rs1_release.171231-1800)

while the kernel version of 1709 is

Kernel Version: 10.0 16299 (16299.15.amd64fre.rs3_release.170928-1534)

And 1709 is only offered as the Server Core installation. It doesn't have a desktop environment. So you won't be able to install Docker for Windows on it.

lcow feature is only available on 1709 according to https://blog.docker.com/2017/09/preview-linux-containers-on-windows/. So you will have to try this feature on 1709.

When it works on 1709, the docker info shows the following:

C:\Users\temp>docker info
Containers: 0
 Running: 0
 Paused: 0
 Stopped: 0
Images: 3
Server Version: master-dockerproject-2018-02-10
Storage Driver: windowsfilter (windows) lcow (linux)
 Windows:
 LCOW:
Logging Driver: json-file
Plugins:
 Volume: local
 Network: ics l2bridge l2tunnel nat null overlay transparent
 Log: awslogs etwlogs fluentd gelf json-file logentries splunk syslog
Swarm: inactive
Default Isolation: process
Kernel Version: 10.0 16299 (16299.15.amd64fre.rs3_release.170928-1534)
Operating System: Windows Server Datacenter
OSType: windows
Architecture: x86_64
CPUs: 4
Total Memory: 16GiB
Name: winsvr1709
ID: W4MK:WLAQ:3NCM:4TUT:CNKP:NPWC:B6TJ:VSC5:LKGU:LT4F:ZEAH:22X3
Docker Root Dir: C:\ProgramData\docker
Debug Mode (client): false
Debug Mode (server): false
Registry: https://index.docker.io/v1/
Labels:
Experimental: true
Insecure Registries:
 127.0.0.0/8
Live Restore Enabled: false

The post regarding how to run Linux containers on Windows Server: https://chunliu.me/2018/02/12/running-linux-containers-on-windows-server-2016/

You can try to switch the environment from the command line:

& 'C:\Program Files\Docker\Docker\DockerCli.exe' -SwitchDaemon

@Oneiroi the issue you’ve linked to is for windows 10. Running docker for windows on windows 10 is not a problem and works fine; none of the resolutions in that ticket are relevant to my question. (You’ll notice on the linked blog post, they say: “UPDATE: LCOW support is available in Windows 10 Fall Creators Update and in Windows Server 1709. On Windows Server 1709, install EE preview.” ← This is exactly what I’m asking how to do.

Redirecting… contains information on how to install the Docker EE preview, please note the caveats however as there are several features noted as missing / not supported, let me know if this helps.

@Oneiroi it does not help. As I’ve pointed out in my question, I’ve done all of those things and it doesn’t work. There are not several feature noted as missing / not supported; it doesn’t work at all. Have you actually tried? If you have, and it somehow works for you please tell me exactly what you did to make it work.

This looks to be an ongoing issue with several options to fix, check this "docker pull" fails in windows 10 · Issue #1100 · docker/for-win · GitHub for further details.

@Oneiroi 1709 is NOT Windows Server 2016 which is version 1609.