# tar --numeric-owner --exclude=/proc --exclude=/sys -cvf centos7-base.tar /
把打包的tar包通过docker import 命令生成镜像,镜像名字为centos7_test
# cat centos7-base.tar |docker import - centos7_test
# docker run -it --rm centos7_test cat /etc/redhat-release CentOS Linux release 7.7.1908 (Core)
借鉴:https://www.cnblogs.com/alexkn/p/3879540.html
原文:https://www.cnblogs.com/yjt1993/p/12795482.html