Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
703 views
in Technique[技术] by (71.8m points)

linux kernel - $(uname -a) returning the same in docker host or any docker container

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

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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

See for more information this question on SuperUser.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...