我拉取的官方centos:latest镜像,运行后运行uname -a没看到centos字样,只有ubuntu,怎么回事啊?
阿神2017-04-22 09:02:30
The kernel of the container is the kernel of the host, and your host is ubuntu
伊谢尔伦2017-04-22 09:02:30
After some research, it seems that the docker kernel is indeed the host kernel
The difference between distributions mainly lies in the organizational form such as file directories and the difference in pre-installed software
The docker image is just a packaged file system and does not include the system kernel
#查看系统的发行说明
cat /etc/issue
#uname是直接调用系统接口得到信息, shell的uname命令实际封装了函数
#include <sys/utsname.h>
int uname(struct utsname *name);
In this case, it shouldn’t be a problem to see two differences.