大网数据广告活动
服务器运维问答

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

· 52CE 我爱测

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 experimen…

问题原文

原帖链接 · Doug · CC BY-SA 4.0

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?

已采纳解答

原帖链接 · Chun Liu · CC BY-SA 4.0

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/

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2018-02-02)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。