您的位置:首页 > 运维架构 > Linux

Centos6下创建Centos6基础镜像

2016-08-09 18:47 344 查看
在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


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

两种简单的制作镜像的方式,其他方式等看到资料时候再补充
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: