找到你要的答案

Q:$(uname -a) returning the same in docker host or any docker container

Q:$(信息一)返回相同的在泊坞窗主机或任何Docker容器

Why $(uname -a) returns the same Linux kernel than the host machine inside a docker container?

uname -a
#=> Linux leo 3.13.0-55-generic #94-Ubuntu SMP Thu Jun 18 00:27:10 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux

docker run -ti --rm ubuntu:vivid-20150611 uname -a
#=> Linux 147c3aff216b 3.13.0-55-generic #94-Ubuntu SMP Thu Jun 18 00:27:10 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux

Even though my host machine is Ubuntu 14.04 (trusty) while the container is Ubuntu 15.04 (vivid) and should have kernel 3.19

为什么美元(信息的)返回相同的Linux内核比在Docker容器主机?

uname -a
#=> Linux leo 3.13.0-55-generic #94-Ubuntu SMP Thu Jun 18 00:27:10 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux

docker run -ti --rm ubuntu:vivid-20150611 uname -a
#=> Linux 147c3aff216b 3.13.0-55-generic #94-Ubuntu SMP Thu Jun 18 00:27:10 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux

虽然我的主机是Ubuntu 14.04(信赖),容器是Ubuntu 15.04(活的),应该有3.19内核

answer1: 回答1:

Docker uses the host OS kernel, there is no custom or additional kernel inside container. All containers runs on machine are sharing this "host" kernel.

See for more information this question on SuperUser.

码头工人使用宿主操作系统的内核,没有自定义或额外的内核容器内。所有在机器上运行的容器都共享这个“主机”内核。

更多信息见对超级用户的问题。

linux-kernel  docker  dockerfile  uname