前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >用supermin制作centos 7 docker 基础镜像

用supermin制作centos 7 docker 基础镜像

作者头像
拓荒者
发布2019-03-11 11:13:37
1.3K0
发布2019-03-11 11:13:37
举报
文章被收录于专栏:运维经验分享运维经验分享

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

代码语言:javascript
复制
  1. NAME
  2. supermin - Tool for creating supermin appliances
  3. SYNOPSIS
  4. supermin [-o OUTPUTDIR] --names LIST OF PKGS ...
  5. supermin [-o OUTPUTDIR] PKG FILE NAMES ...
  6. DESCRIPTION
  7. Supermin is a tool for building supermin appliances. These are tiny appliances (similar to virtual machines), usually
  8. around 100KB in size, which get fully instantiated on-the-fly in a fraction of a second when you need to boot one of
  9. them.
  10. Originally "fe" in "febootstrap" stood for "Fedora", but this tool is now distro-independent and can build supermin
  11. appliances for several popular Linux distros, and adding support for others is reasonably easy. For this reason,
  12. starting with version 4, we have renamed the tool "supermin".
  13. Note that this manual page documents supermin 4.x which is a complete rewrite and quite different from febootstrap 2.x.
  14. If you are looking for the febootstrap 2.x tools, then this is not the right place.

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

代码语言:javascript
复制
  1. [root@centos7 ~]# supermin5 --help
  2. supermin - tool for creating supermin appliances
  3. Copyright (C) 2009-2014 Red Hat Inc.
  4. Usage:
  5. supermin --prepare LIST OF PACKAGES ...
  6. supermin --build INPUT [INPUT ...]
  7. For full instructions, read the supermin(1) man page.
  8. Options:
  9. --build Build a full appliance
  10. --copy-kernel Copy kernel instead of symlinking
  11. --dtb WILDCARD Find device tree matching wildcard
  12. -f chroot|ext2 Set output format
  13. --format -"-
  14. --host-cpu ARCH Set host CPU architecture
  15. --if-newer Only build if needed
  16. --include-packagelist Add a file with the list of packages
  17. --list-drivers Display list of drivers and exit
  18. --lock LOCKFILE Use a lock file
  19. --names Give an error for people needing supermin 4
  20. -o OUTPUTDIR Set output directory
  21. --packager-config CONFIGFILE Set packager config file
  22. --prepare Prepare a supermin appliance
  23. --size Set the size of the ext2 filesystem
  24. --use-installed Use installed files instead of accessing network
  25. -v Enable debugging messages
  26. --verbose -"-
  27. -V Display version and exit
  28. --version -"-
  29. -help Display this list of options
  30. --help Display this list of options

如果找不到该命令,用 yum install supermin* 安装。

步骤-1

代码语言:javascript
复制
supermin5 -v --prepare bash coreutils -o supermin.d

步骤-2

代码语言:javascript
复制
supermin5 -v --build --format chroot supermin.d -o appliance.d

步骤-3

代码语言:javascript
复制
  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

代码语言:javascript
复制
 cat centos-7-2.tar | docker import - oliver/centos:v7.2

制作镜像时想包含某个命令,但又不知道在哪个包时,可以用yum whatprovides 来查找。

代码语言:javascript
复制
  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. net-tools-2.0-0.17.20131004git.el7.x86_64 : Basic networking tools
  12. 源 :installed
  13. 匹配来源:
  14. 文件名 :/sbin/ifconfig

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

文章标签: docker基础镜像supermin5docker

(adsbygoogle = window.adsbygoogle || []).push({});

本文参与 腾讯云自媒体分享计划,分享自作者个人站点/博客。
原始发表:2018/08/20 ,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
相关产品与服务
容器镜像服务
容器镜像服务(Tencent Container Registry,TCR)为您提供安全独享、高性能的容器镜像托管分发服务。您可同时在全球多个地域创建独享实例,以实现容器镜像的就近拉取,降低拉取时间,节约带宽成本。TCR 提供细颗粒度的权限管理及访问控制,保障您的数据安全。
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档