Centos6下创建Centos6基础镜像

Centos6下创建Centos6基础镜像

 
  1. 在centos6下可以使用官方仓库拉取一个指定系统类型跟tag的镜像到本地
[root@localhost ~]# docker pull centos:6.8
6.8: Pulling from centos
3690474eb5b4: Pull complete 
b92e3b877355: Downloading [>                                                  ] 537.7 kB/68.75 MB
7392cee6d21b: Download complete 
c51f770ba2ca: Download complete 
c51f770ba2ca: Pulling fs layer

等到安装完了可以查看本地镜像

[root@localhost ~]# docker images
REPOSITORY          TAG                 IMAGE ID            CREATED             VIRTUAL SIZE
centos              6.8                 b8248de1851f        14 minutes ago      333.6 MB
  1. centos6下使用febootstrap制作本地镜像

安装febootstrap

yum -y install febootstrap

制作Docker镜像

febootstrap -i bash -i wget -i yum -i iputils -i iproute -i man -i vim-minimal -i openssh-server -i openssh-clients centos6 centos6-image http://mirrors.aliyun.com/centos/6/os/x86_64/

cd centos6-image && tar -c .|docker import - centos:6.8

等到制作完成后

[root@localhost ~]# docker images
REPOSITORY          TAG                 IMAGE ID            CREATED             VIRTUAL SIZE
centos              6.8                 b8248de1851f        14 minutes ago      333.6 MB

两种简单的制作镜像的方式,其他方式等看到资料时候再补充

posted @ 2018-11-14 11:42  lypcper  阅读(205)  评论(0编辑  收藏  举报