Home  >  Q&A  >  body text

docker-images - docker官方拉取的centos最新镜像系统信息却是ubuntu怎么回事啊?

我拉取的官方centos:latest镜像,运行后运行uname -a没看到centos字样,只有ubuntu,怎么回事啊?

迷茫迷茫2760 days ago659

reply all(2)I'll reply

  • 阿神

    阿神2017-04-22 09:02:30

    The kernel of the container is the kernel of the host, and your host is ubuntu

    reply
    0
  • 伊谢尔伦

    伊谢尔伦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.

    reply
    0
  • Cancelreply