【问题标题】:How do I run an ubuntu container on windows?如何在 Windows 上运行 ubuntu 容器?
【发布时间】:2018-03-10 12:42:51
【问题描述】:

我是 Docker 新手,并按照入门文档https://docs.docker.com/docker-for-windows/#explore-the-application-and-run-examples 进行操作。

当我运行“docker run -it ubuntu bash”时,出现以下错误:

无法在本地找到图像“ubuntu:latest”最新:从 库/ubuntu C:\Program Files\Docker\Docker\Resources\bin\docker.exe:没有匹配的清单 清单列表条目中的 windows/amd64。见'C:\程序 Files\Docker\Docker\Resources\bin\docker.exe 运行 --help'。

这里是其他 docker 信息:

码头工人版本

Client:
 Version:      17.06.1-ce
 API version:  1.30
 Go version:   go1.8.3
 Git commit:   874a737
 Built:        Thu Aug 17 22:48:20 2017
 OS/Arch:      windows/amd64

Server:
 Version:      17.06.1-ce
 API version:  1.30 (minimum version 1.24)
 Go version:   go1.8.3
 Git commit:   874a737
 Built:        Thu Aug 17 23:03:03 2017
 OS/Arch:      windows/amd64
 Experimental: true

码头工人信息

Containers: 1
 Running: 0
 Paused: 0
 Stopped: 1
Images: 1
Server Version: 17.06.1-ce
Storage Driver: windowsfilter
 Windows:
Logging Driver: json-file
Plugins:
 Volume: local
 Network: l2bridge l2tunnel nat null overlay transparent
 Log: awslogs etwlogs fluentd json-file logentries splunk syslog
Swarm: inactive
Default Isolation: hyperv
Kernel Version: 10.0 15063 (15063.0.amd64fre.rs2_release.170317-1834)
Operating System: Windows 10 Pro
OSType: windows
Architecture: x86_64
CPUs: 12
Total Memory: 31.92GiB
ID: ZVBR:TM24:KXS3:NF5Y:WJTD:7JR3:S4UB:TFIZ:7G32:EHIL:4TKD:RK3V
Docker Root Dir: C:\ProgramData\Docker
Debug Mode (client): false
Debug Mode (server): true
 File Descriptors: -1
 Goroutines: 20
 System Time: 2017-09-28T10:05:53.8801328-07:00
 EventsListeners: 0
Registry: https://index.docker.io/v1/
Experimental: true
Insecure Registries:
 127.0.0.0/8
Live Restore Enabled: false

我有点困惑,为什么 OS/Arch 版本显示 windows/amd64 而架构下的 info 显示 x86_64。

任何有关错误消息的帮助都会很棒。

【问题讨论】:

  • amd64 是 64 位 x86 架构的 Linux 名称,而 x86_64 是它的 Windows(嗯,英特尔)名称。
  • 感谢洪澄清。
  • 您可能必须使用 --experimental 标志运行 docker 守护程序。 dockerd.exe --experimental
  • 我想过,虽然它作为 Windows 服务运行并且 docker info 已经显示,但实验性:true。

标签: windows docker


【解决方案1】:

您的问题是您在 Windows 容器模式下使用 docker 并尝试拉取一个 ubuntu 映像,该映像是 linux 容器映像。你不能那样做。您可以运行 windows 容器,也可以运行 linux 容器。

您可以通过右键单击 docker 托盘图标来切换到 Linux 容器模式,如下图所示

另外,windows/amd64x86_64 都表示 64 位操作系统,仅此而已

【讨论】:

  • 这显然修复了它,我对 Docker 有了更多了解,谢谢。我的印象是,这会切换使用的虚拟化技术,但可以运行 windows 或 linux 容器。
  • 我也有同样的印象。如果我在 linux 容器下运行 hello-world,则图像大小以 kb 为单位;在 Windows 容器中,它是几百 mb。对此有何解释?有关系吗?如果他们想同时拥有两者的图像,是否有可能?我的猜测是它在 Windows 容器中安装了一些管理程序。我错了吗?
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2018-01-04
  • 1970-01-01
  • 2014-01-16
  • 2019-10-03
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多