我拉取的官方centos:latest鏡像,運行后運行uname -a沒看到centos字樣,只有ubuntu,怎么回事???
業(yè)精于勤,荒于嬉;行成于思,毀于隨。
The kernel of the container is the kernel of the host, and your host is ubuntu
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
#查看系統(tǒng)的發(fā)行說明
cat /etc/issue
#uname是直接調用系統(tǒng)接口得到信息, shell的uname命令實際封裝了函數
#include <sys/utsname.h>
int uname(struct utsname *name);
In this case, it shouldn’t be a problem to see two differences.