supermin5构建镜像

Docker使用supermin5工具构建镜像


1 针对于这个案例,我们首先安装我们的supermin5 工具

[root@server media]# yum install -y supermin5
 Loaded plugins: fastestmirror
 centos                                                                                                          | 3.6 kB  
 00:00:00     
 docker                                                                                                          | 2.9 kB  
 00:00:00     
 Loading mirror speeds from cached hostfile
 Resolving Dependencies
 --> Running transaction check
 ---> Package supermin5.x86_64 0:5.1.10-1.2.el7 will be installed
 --> Processing Dependency: yum-utils for package: supermin5-5.1.10-1.2.el7.x86_64
 --> Running transaction check
 ---> Package yum-utils.noarch 0:1.1.31-34.el7 will be installed
 --> Processing Dependency: python-kitchen for package: yum-utils-1.1.31-34.el7.noarch
 --> Running transaction check
 ---> Package python-kitchen.noarch 0:1.1.1-5.el7 will be installed
 --> Processing Dependency: python-chardet for package: python-kitchen-1.1.1- 5.el7.noarch
 --> Running transaction check
 ---> Package python-chardet.noarch 0:2.2.1-1.el7_1 will be installed
 --> Finished Dependency Resolution

 Dependencies Resolved

=======================================================================================================================================
  Package                             Arch                        Version                             Repository                   Size
=======================================================================================================================================
 Installing:
 supermin5                           x86_64                      5.1.10-1.2.el7                      centos                      574 k
 Installing for dependencies:
 python-chardet                      noarch                      2.2.1-1.el7_1                       centos                      227 k
 python-kitchen                      noarch                      1.1.1-5.el7                         centos                      267 k
 yum-utils                           noarch                      1.1.31-34.el7                       centos                      113 k

 Transaction Summary
=======================================================================================================================================
 Install  1 Package (+3 Dependent packages)

 Total download size: 1.2 M
 Installed size: 4.3 M
 Downloading packages:
---------------------------------------------------------------------------------------------------------------------------------------
 Total                                                                                                   49 MB/s | 1.2 MB  
 00:00:00     
 Running transaction check
 Running transaction test
 Transaction test succeeded
 Running transaction
   Installing : python-chardet-2.2.1-1.el7_1.noarch                                                                                 
 1/4 
   Installing : python-kitchen-1.1.1-5.el7.noarch                                                                                   
 2/4 
   Installing : yum-utils-1.1.31-34.el7.noarch                                                                                      
 3/4 
   Installing : supermin5-5.1.10-1.2.el7.x86_64                                                                                     
 4/4 
   Verifying  : python-kitchen-1.1.1-5.el7.noarch                                                                                   
 1/4 
   Verifying  : supermin5-5.1.10-1.2.el7.x86_64                                                                                     
 2/4 
   Verifying  : yum-utils-1.1.31-34.el7.noarch                                                                                      
 3/4 
   Verifying  : python-chardet-2.2.1-1.el7_1.noarch                                                                                 
 4/4 

 Installed:
   supermin5.x86_64 0:5.1.10-1.2.el7                                                                                                    

 Dependency Installed:
   python-chardet.noarch 0:2.2.1-1.el7_1          python-kitchen.noarch 0:1.1.1-5.el7          
 yum-utils.noarch 0:1.1.31-34.el7         

 Complete!

2 下面开始使用supermin5制作我们所需要的镜像所需的安装包。下面命令是准备要安装的软件包并保存在supermin.d目录下

[root@server media]# supermin5 -v --prepare bash yum  net-tools initscripts  vi  coreutils -o supermin.d
  supermin: version: 5.1.10
  supermin: rpm: detected RPM version 4.11
  supermin: package handler: fedora/rpm
  supermin: prepare: bash yum net-tools initscripts vi coreutils
  supermin: packages specified on the command line:
    - bash-4.2.46-19.el7.x86_64
    - yum-3.4.3-132.el7.centos.0.1.noarch
    - initscripts-9.49.30-1.el7.x86_64
    - coreutils-8.22-15.el7.x86_64  
  supermin: writing supermin.d.1tcmz1m8/packages
  supermin: after resolving dependencies there are 135 packages:
    - acl-2.2.51-12.el7.x86_64
    - audit-libs-2.4.1-5.el7.x86_64
    - basesystem-10.0-7.el7.centos.noarch
    - bash-4.2.46-19.el7.x86_64
    - binutils-2.23.52.0.1-55.el7.x86_64
    - bzip2-libs-1.0.6-13.el7.x86_64
    - ca-certificates-2015.2.4-71.el7.noarch
    - centos-release-7-2.1511.el7.centos.2.10.x86_64
    - chkconfig-1.3.61-5.el7.x86_64
    - coreutils-8.22-15.el7.x86_64
    - cpio-2.11-24.el7.x86_64
    - cracklib-2.9.0-11.el7.x86_64
    - cracklib-dicts-2.9.0-11.el7.x86_64
    - cryptsetup-libs-1.6.7-1.el7.x86_64
    - curl-7.29.0-25.el7.centos.x86_64
    - cyrus-sasl-lib-2.1.26-19.2.el7.x86_64
    - dbus-1:1.6.12-13.el7.x86_64
    - dbus-libs-1:1.6.12-13.el7.x86_64
    - device-mapper-7:1.02.107-5.el7.x86_64
    - device-mapper-libs-7:1.02.107-5.el7.x86_64
    - diffutils-3.3-4.el7.x86_64
    - dracut-033-502.el7_4.1.x86_64
    - elfutils-libelf-0.163-3.el7.x86_64
    - elfutils-libs-0.163-3.el7.x86_64
    - expat-2.1.0-8.el7.x86_64
    - file-libs-5.11-31.el7.x86_64
    - filesystem-3.2-20.el7.x86_64
    - findutils-1:4.5.11-5.el7.x86_64
    - gawk-4.0.2-4.el7.x86_64
    - gdbm-1.10-8.el7.x86_64
    - glib2-2.42.2-5.el7.x86_64
    - glibc-2.17-105.el7.x86_64
    - glibc-common-2.17-105.el7.x86_64
    - gmp-1:6.0.0-11.el7.x86_64
    - gnupg2-2.0.22-3.el7.x86_64
    - gpgme-1.3.2-5.el7.x86_64
    - grep-2.20-2.el7.x86_64
    - gzip-1.5-8.el7.x86_64
    - hardlink-1:1.0-19.el7.x86_64
    - hostname-3.13-3.el7.x86_64
    - info-5.1-4.el7.x86_64
    - initscripts-9.49.30-1.el7.x86_64
    - iproute-3.10.0-54.el7.x86_64
    - iptables-1.4.21-16.el7.x86_64
    - iputils-20121221-7.el7.x86_64
    - keyutils-libs-1.5.8-3.el7.x86_64
    - kmod-20-5.el7.x86_64
    - kmod-libs-20-5.el7.x86_64
    - kpartx-0.4.9-85.el7.x86_64
    - krb5-libs-1.13.2-10.el7.x86_64
    - libacl-2.2.51-12.el7.x86_64
    - libassuan-2.1.0-3.el7.x86_64
    - libattr-2.4.46-12.el7.x86_64
    - libblkid-2.23.2-26.el7.x86_64
    - libcap-2.22-8.el7.x86_64
    - libcap-ng-0.7.5-4.el7.x86_64
    - libcom_err-1.42.9-7.el7.x86_64
    - libcurl-7.29.0-25.el7.centos.x86_64
    - libdb-5.3.21-19.el7.x86_64
    - libdb-utils-5.3.21-19.el7.x86_6
    - libffi-3.0.13-16.el7.x86_64
    - libgcc-4.8.5-4.el7.x86_64
    - libgcrypt-1.5.3-12.el7_1.1.x86_64
    - libgpg-error-1.12-3.el7.x86_64
    - libidn-1.28-4.el7.x86_64
    - libmnl-1.0.3-7.el7.x86_64
    - libmount-2.23.2-26.el7.x86_64
    - libnetfilter_conntrack-1.0.4-2.el7.x86_64
    - libnfnetlink-1.0.1-4.el7.x86_64
    - libpwquality-1.2.3-4.el7.x86_64
    - libselinux-2.5-11.el7.x86_64
    - libsemanage-2.5-8.el7.x86_64
    - libsepol-2.5-6.el7.x86_64
    - libssh2-1.4.3-10.el7.x86_64
    - libstdc++-4.8.5-4.el7.x86_64
    - libtasn1-3.8-2.el7.x86_64
    - libuser-0.60-7.el7_1.x86_64
    - libutempter-1.1.6-4.el7.x86_64
    - libuuid-2.23.2-26.el7.x86_64
    - libverto-0.2.5-4.el7.x86_64
    - libxml2-2.9.1-5.el7_1.2.x86_64
    - lua-5.1.4-14.el7.x86_64
    - ncurses-5.9-13.20130511.el7.x86_64
    - ncurses-base-5.9-13.20130511.el7.noarch
    - ncurses-libs-5.9-13.20130511.el7.x86_64
    - nspr-4.10.8-2.el7_1.x86_64
    - nss-3.19.1-18.el7.x86_64
    - nss-softokn-3.16.2.3-13.el7_1.x86_64
    - nss-softokn-freebl-3.16.2.3-13.el7_1.x86_64
    - nss-sysinit-3.19.1-18.el7.x86_64
    - nss-tools-3.19.1-18.el7.x86_64
    - nss-util-3.19.1-4.el7_1.x86_64
    - openldap-2.4.40-8.el7.x86_64
    - openssl-libs-1:1.0.1e-42.el7.9.x86_64
    - p11-kit-0.20.7-3.el7.x86_64
    - p11-kit-trust-0.20.7-3.el7.x86_64
    - pam-1.1.8-12.el7_1.1.x86_64
    - pcre-8.32-15.el7.x86_64
    - pinentry-0.8.1-14.el7.x86_64
    - pkgconfig-1:0.27.1-4.el7.x86_64
    - popt-1.13-16.el7.x86_64
    - procps-ng-3.3.10-3.el7.x86_64
    - pth-2.0.7-23.el7.x86_64
    - pygpgme-0.3-9.el7.x86_64
    - pyliblzma-0.5.3-11.el7.x86_64
    - python-2.7.5-34.el7.x86_64
    - python-iniparse-0.4-9.el7.noarch
    - python-libs-2.7.5-34.el7.x86_64
    - python-pycurl-7.19.0-17.el7.x86_64
    - python-urlgrabber-3.10-7.el7.noarch
    - pyxattr-0.5.1-5.el7.x86_64
    - qrencode-libs-3.4.1-3.el7.x86_64
    - readline-6.2-9.el7.x86_64
    - rpm-4.11.3-17.el7.x86_64
    - rpm-build-libs-4.11.3-17.el7.x86_64
    - rpm-libs-4.11.3-17.el7.x86_64
    - rpm-python-4.11.3-17.el7.x86_64
    - sed-4.2.2-5.el7.x86_64
    - setup-2.8.71-6.el7.noarch
    - shadow-utils-2:4.1.5.1-18.el7.x86_64
    - shared-mime-info-1.1-9.el7.x86_64
    - sqlite-3.7.17-8.el7.x86_64
    - systemd-219-42.el7_4.6.x86_64
    - systemd-libs-219-42.el7_4.6.x86_64
    - sysvinit-tools-2.88-14.dsf.el7.x86_64
    - tar-2:1.26-29.el7.x86_64
    - tzdata-2015g-1.el7.noarch
    - ustr-1.0.4-16.el7.x86_64
    - util-linux-2.23.2-26.el7.x86_64
    - xz-5.1.2-12alpha.el7.x86_64
    - xz-libs-5.1.2-12alpha.el7.x86_64
    - yum-3.4.3-132.el7.centos.0.1.noarch
    - yum-metadata-parser-1.1.4-10.el7.x86_64
    - yum-plugin-fastestmirror-1.1.31-34.el7.noarch
    - zlib-1.2.7-15.el7.x86_64
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
(1/32): audit-libs-2.4.1-5.el7.x86_64.rpm                                                                       |  80 kB  00:00:00     
(2/32): ca-certificates-2015.2.4-71.el7.noarch.rpm                                                              | 441 kB  00:00:00     
(3/32): centos-release-7-2.1511.el7.centos.2.10.x86_64.rpm                                                      |  23 kB  00:00:00     
(4/32): coreutils-8.22-15.el7.x86_64.rpm                                                                        | 3.2 MB  00:00:00     
(5/32): bash-4.2.46-19.el7.x86_64.rpm                                                                           | 1.0 MB  00:00:00     
(6/32): dbus-1.6.12-13.el7.x86_64.rpm                                                                           | 306 kB  00:00:00     
(7/32): glibc-2.17-105.el7.x86_64.rpm                                                                           | 3.6 MB  00:00:00     
(8/32): gnupg2-2.0.22-3.el7.x86_64.rpm                                                                          | 1.5 MB  00:00:00     
(9/32): grep-2.20-2.el7.x86_64.rpm                                                                              | 344 kB  00:00:00     
(10/32): glibc-common-2.17-105.el7.x86_64.rpm                                                                   |  11 MB  00:00:00     
(11/32): dracut-033-502.el7_4.1.x86_64.rpm                                                                      | 321 kB  00:00:00     
(12/32): info-5.1-4.el7.x86_64.rpm                                                                              | 233 kB  00:00:00     
(13/32): iptables-1.4.21-16.el7.x86_64.rpm                                                                      | 424 kB  00:00:00     
(14/32): iputils-20121221-7.el7.x86_64.rpm                                                                      | 152 kB  00:00:00     
(15/32): krb5-libs-1.13.2-10.el7.x86_64.rpm                                                                     | 843 kB  00:00:00     
(16/32): libpwquality-1.2.3-4.el7.x86_64.rpm                                                                    |  84 kB  00:00:00     
(17/32): libuser-0.60-7.el7_1.x86_64.rpm                                                                        | 398 kB  00:00:00     
(18/32): iproute-3.10.0-54.el7.x86_64.rpm                                                                       | 526 kB  00:00:00     
(19/32): initscripts-9.49.39-1.el7_4.1.x86_64.rpm                                                               | 435 kB  00:00:00     
(20/32): nss-3.28.4-15.el7_4.x86_64.rpm                                                                         | 849 kB  00:00:00     
(21/32): libsemanage-2.5-8.el7.x86_64.rpm                                                                       | 145 kB  00:00:00     
(22/32): openssl-libs-1.0.1e-42.el7.9.x86_64.rpm                                                                | 949 kB  00:00:00     
(23/32): openldap-2.4.40-8.el7.x86_64.rpm                                                                       | 348 kB  00:00:00     
(24/32): python-libs-2.7.5-34.el7.x86_64.rpm                                                                    | 5.6 MB  00:00:00     
(25/32): pam-1.1.8-12.el7_1.1.x86_64.rpm                                                                        | 714 kB  00:00:00     
(26/32): rpm-4.11.3-17.el7.x86_64.rpm                                                                           | 1.2 MB  00:00:00     
(27/32): setup-2.8.71-6.el7.noarch.rpm                                                                          | 165 kB  00:00:00     
(28/32): shadow-utils-4.1.5.1-18.el7.x86_64.rpm                                                                 | 1.1 MB  00:00:00     
(29/32): util-linux-2.23.2-26.el7.x86_64.rpm                                                                    | 1.9 MB  00:00:00     
(30/32): yum-3.4.3-132.el7.centos.0.1.noarch.rpm                                                                | 1.2 MB  00:00:00     
(31/32): yum-plugin-fastestmirror-1.1.31-34.el7.noarch.rpm                                                      |  30 kB  00:00:00     
(32/32): systemd-219-42.el7_4.6.x86_64.rpm                                                                      | 5.2 MB  00:00:00     
supermin: writing supermin.d.1tcmz1m8/base.tar.gz
supermin: renaming supermin.d.1tcmz1m8 to supermin.d

3 下面开始构建我们的镜像。下面命令是根据上一步准备的安装包目录制作隔离的环境,并保存在appliance.d目录下

[root@server media]# supermin5 -v --build --format chroot supermin.d -o appliance.d
  supermin: version: 5.1.10
  supermin: rpm: detected RPM version 4.11
  supermin: package handler: fedora/rpm
  supermin: build: supermin.d
  supermin: build: visiting supermin.d/base.tar.gz type gzip base image (tar)
  supermin: build: visiting supermin.d/packages type uncompressed packages
  supermin: build: 135 packages, including dependencies
  supermin: build: 26059 files
  supermin: build: 12875 files, after removing unreadable files
  supermin: build: 12875 files, after matching excludefiles
  supermin: build: 12875 files, after adding hostfiles
  supermin: build: 12913 files, after munging
  supermin: renaming appliance.d.idqctht6 to appliance.d

4 如果要使用yum安装软件包,可以执行我们的下面的命令

[root@server media]# echo 7 > appliance.d/etc/yum/vars/releasever

5 如果要上网,则要执行我们下面的命令

[root@server media]#  cp /etc/resolv.conf appliance.d/etc/

6 然后开始构建我们的镜像

[root@server media]# tar  --numeric-owner -cpf centos-7.tar -C appliance.d/ .

7 开始导入我们的容器

[root@server media]# cat centos-7.tar | docker import - 10.0.3.137:5000/centos-8888
sha256:d06398dcf03fc1d3ef0be50dc5759948775933adc177237644fb5510981c3990

8 使用docker命令查看我们的容器

root@server media]# docker images | grep  centos-8888
10.0.3.137:5000/centos-8888               latest              d06398dcf03f        4 minutes ago       260.6 MB



原文链接:https://blog.csdn.net/qq_28513801/java/article/details/90808962

©著作权归作者所有,转载或内容合作请联系作者
  • 序言:七十年代末,一起剥皮案震惊了整个滨河市,随后出现的几起案子,更是在滨河造成了极大的恐慌,老刑警刘岩,带你破解...
    沈念sama阅读 218,036评论 6 506
  • 序言:滨河连续发生了三起死亡事件,死亡现场离奇诡异,居然都是意外死亡,警方通过查阅死者的电脑和手机,发现死者居然都...
    沈念sama阅读 93,046评论 3 395
  • 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
    开封第一讲书人阅读 164,411评论 0 354
  • 文/不坏的土叔 我叫张陵,是天一观的道长。 经常有香客问我,道长,这世上最难降的妖魔是什么? 我笑而不...
    开封第一讲书人阅读 58,622评论 1 293
  • 正文 为了忘掉前任,我火速办了婚礼,结果婚礼上,老公的妹妹穿的比我还像新娘。我一直安慰自己,他们只是感情好,可当我...
    茶点故事阅读 67,661评论 6 392
  • 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
    开封第一讲书人阅读 51,521评论 1 304
  • 那天,我揣着相机与录音,去河边找鬼。 笑死,一个胖子当着我的面吹牛,可吹牛的内容都是我干的。 我是一名探鬼主播,决...
    沈念sama阅读 40,288评论 3 418
  • 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
    开封第一讲书人阅读 39,200评论 0 276
  • 序言:老挝万荣一对情侣失踪,失踪者是张志新(化名)和其女友刘颖,没想到半个月后,有当地人在树林里发现了一具尸体,经...
    沈念sama阅读 45,644评论 1 314
  • 正文 独居荒郊野岭守林人离奇死亡,尸身上长有42处带血的脓包…… 初始之章·张勋 以下内容为张勋视角 年9月15日...
    茶点故事阅读 37,837评论 3 336
  • 正文 我和宋清朗相恋三年,在试婚纱的时候发现自己被绿了。 大学时的朋友给我发了我未婚夫和他白月光在一起吃饭的照片。...
    茶点故事阅读 39,953评论 1 348
  • 序言:一个原本活蹦乱跳的男人离奇死亡,死状恐怖,灵堂内的尸体忽然破棺而出,到底是诈尸还是另有隐情,我是刑警宁泽,带...
    沈念sama阅读 35,673评论 5 346
  • 正文 年R本政府宣布,位于F岛的核电站,受9级特大地震影响,放射性物质发生泄漏。R本人自食恶果不足惜,却给世界环境...
    茶点故事阅读 41,281评论 3 329
  • 文/蒙蒙 一、第九天 我趴在偏房一处隐蔽的房顶上张望。 院中可真热闹,春花似锦、人声如沸。这庄子的主人今日做“春日...
    开封第一讲书人阅读 31,889评论 0 22
  • 文/苍兰香墨 我抬头看了看天上的太阳。三九已至,却和暖如春,着一层夹袄步出监牢的瞬间,已是汗流浃背。 一阵脚步声响...
    开封第一讲书人阅读 33,011评论 1 269
  • 我被黑心中介骗来泰国打工, 没想到刚下飞机就差点儿被人妖公主榨干…… 1. 我叫王不留,地道东北人。 一个月前我还...
    沈念sama阅读 48,119评论 3 370
  • 正文 我出身青楼,却偏偏与公主长得像,于是被迫代替她去往敌国和亲。 传闻我的和亲对象是个残疾皇子,可洞房花烛夜当晚...
    茶点故事阅读 44,901评论 2 355