4

我在这里可能完全错了,但是,我从 docker 注册表中提取了32bit/ubuntuuname -a ,然后运行我得到x86_64

➜  ~  docker images
REPOSITORY               TAG                 IMAGE ID            CREATED             VIRTUAL SIZE
erlang-build-box         latest              fd61e832201b        7 weeks ago         1.841 GB
hello-world              latest              e45a5af57b00        9 weeks ago         910 B
32bit/ubuntu             14.04               6de534a1b6e3        4 months ago        290.7 MB
phusion/passenger-full   0.9.10              29eb0419ab6f        10 months ago       649.3 MB
➜  ~  docker run -t -i 6de534a1b6e3 /bin/bash
root@c40d7c09be96:/# uname -a 
Linux c40d7c09be96 3.16.7-tinycore64 #1 SMP Tue Dec 16 23:03:39 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
root@c40d7c09be96:/# uname -m
x86_64
root@c40d7c09be96:/# 

我对这台机器的理解是错误的64bit吗?

4

3 回答 3

5

Docker 容器始终使用主机的内核。你有一个 64 位主机,所以这就是它的报告。

容器映像是 32 位的,因为所有二进制文件都是 32 位的,并且可以由 32 位架构处理。

Docker 不做虚拟化。

于 2015-03-09T22:55:58.947 回答
1

https://github.com/docker/docker/issues/611中提取

uname 总是会告诉你 64 位。查看例如“文件/bin/sh”以查看文件系统的真正拱门。

于 2015-03-10T07:41:01.247 回答
0

Just a note: systemd-nspawn can "virtualize" the processor mode, and trick the processes inside to believe it is a 32-bit processor (tested by me). AFAIK, LXC can too.

And I mean that running "uname -m" returns "i686" (and my host OS is running in 64 bit mode)

于 2015-09-28T08:37:04.347 回答