1、把当前的环境打包

# tar --numeric-owner --exclude=/proc --exclude=/sys -cvf centos7-base.tar /

2、制作镜像

把打包的tar包通过docker import 命令生成镜像,镜像名字为centos7_test

# cat centos7-base.tar |docker import - centos7_test

3、测试

# 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

相关文章:

  • 2021-11-21
  • 2022-12-23
  • 2022-12-23
  • 2021-09-13
  • 2021-12-20
  • 2022-01-09
  • 2021-08-21
  • 2021-10-30
猜你喜欢
  • 2021-12-08
  • 2021-04-03
  • 2021-11-30
  • 2021-10-13
  • 2021-09-01
  • 2021-10-13
相关资源
相似解决方案