用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

相關文章
相關標籤/搜索