用supermin制做centos 7 docker 基础镜像

用supermin制做centos 7 docker 基础镜像

2017年06月04日 16:07:32git

阅读数:3164docker

supermin5 一个工具,运行命令man supermin能够查看关于这个工具的基本信息。bootstrap

 

 
  1. NAMEcentos

  2. supermin - Tool for creating supermin appliancesbash

  3.  
  4. SYNOPSISapp

  5. supermin [-o OUTPUTDIR] --names LIST OF PKGS ...ide

  6. supermin [-o OUTPUTDIR] PKG FILE NAMES ...工具

  7.  
  8. DESCRIPTIONui

  9. Supermin is a tool for building supermin appliances. These are tiny appliances (similar to virtual machines), usuallythis

  10. around 100KB in size, which get fully instantiated on-the-fly in a fraction of a second when you need to boot one of

  11. them.

  12.  
  13. Originally "fe" in "febootstrap" stood for "Fedora", but this tool is now distro-independent and can build supermin

  14. appliances for several popular Linux distros, and adding support for others is reasonably easy. For this reason,

  15. starting with version 4, we have renamed the tool "supermin".

  16.  
  17. Note that this manual page documents supermin 4.x which is a complete rewrite and quite different from febootstrap 2.x.

  18. If you are looking for the febootstrap 2.x tools, then this is not the right place.

运行命令supermin5 --help能够查看基本的使用方法

 

 

 
  1. [root@centos7 ~]# supermin5 --help

  2. supermin - tool for creating supermin appliances

  3. Copyright (C) 2009-2014 Red Hat Inc.

  4.  
  5. Usage:

  6.  
  7. supermin --prepare LIST OF PACKAGES ...

  8. supermin --build INPUT [INPUT ...]

  9.  
  10. For full instructions, read the supermin(1) man page.

  11.  
  12. Options:

  13.  
  14. --build Build a full appliance

  15. --copy-kernel Copy kernel instead of symlinking

  16. --dtb WILDCARD Find device tree matching wildcard

  17. -f chroot|ext2 Set output format

  18. --format -"-

  19. --host-cpu ARCH Set host CPU architecture

  20. --if-newer Only build if needed

  21. --include-packagelist Add a file with the list of packages

  22. --list-drivers Display list of drivers and exit

  23. --lock LOCKFILE Use a lock file

  24. --names Give an error for people needing supermin 4

  25. -o OUTPUTDIR Set output directory

  26. --packager-config CONFIGFILE Set packager config file

  27. --prepare Prepare a supermin appliance

  28. --size Set the size of the ext2 filesystem

  29. --use-installed Use installed files instead of accessing network

  30. -v Enable debugging messages

  31. --verbose -"-

  32. -V Display version and exit

  33. --version -"-

  34. -help Display this list of options

  35. --help Display this list of options

若是找不到该命令,用 yum install supermin* 安装。

 

步骤-1

 

supermin5 -v --prepare bash coreutils -o supermin.d

 

步骤-2

supermin5 -v --build --format chroot supermin.d -o appliance.d


步骤-3

 

 

 
  1. echo 7.2 > appliance.d/etc/yum/vars/releasever

  2. tar --numeric-owner -cpf centos-7-2.tar -C appliance.d .


步骤-4导入tar文件到docker

 

 

cat centos-7-2.tar | docker import - oliver/centos:v7.2

 

制做镜像时想包含某个命令,但又不知道在哪一个包时,能够用yum whatprovides 来查找。

 

 
  1. [root@centos7 images]# yum whatprovides */ifconfig

  2. 已加载插件:fastestmirror

  3. Loading mirror speeds from cached hostfile

  4. * base: centos.ustc.edu.cn

  5. * extras: mirrors.cn99.com

  6. * updates: mirrors.cn99.com

  7. net-tools-2.0-0.17.20131004git.el7.x86_64 : Basic networking tools

  8. 源 :base

  9. 匹配来源:

  10. 文件名 :/sbin/ifconfig

  11.  
  12.  
  13.  
  14. net-tools-2.0-0.17.20131004git.el7.x86_64 : Basic networking tools

  15. 源 :installed

  16. 匹配来源:

  17. 文件名 :/sbin/ifconfig


 

 

版权声明:本文为博主原创文章,未经博主容许不得转载。 https://blog.csdn.net/hjh00/article/details/72859287

文章标签: docker基础镜像supermin5docker

相关文章
相关标签/搜索