红联Linux门户
Linux帮助

使用supermin制作CentOS的Docker镜像

发布时间:2016-09-22 10:41:16来源:blog.csdn.net/kongxx作者:kongxx
在CentOS7上安装supermin:
$ sudo yum install -y supermin*
 
创建镜像:(以下命令需要使用root运行)
# supermin5 -v --prepare bash coreutils -o supermin.d
# supermin5 -v --build --format chroot supermin.d -o appliance.d
# echo 7 > appliance.d/etc/yum/vars/releasever
# tar --numeric-owner -cpf centos-7.tar -C appliance.d .
# cat centos-7.tar | docker import - kongxx/centos-7
 
查看镜像:
$ sudo docker images
REPOSITORY  TAG  IMAGE ID  CREATED  SIZE
kongxx/centos-7  latest  8c8f006aac6b  About a minute ago  167 MB
...
 
运行容器:
$ sudo docker run -i -t kongxx/centos-7 /bin/bash
bash-4.2# cat /etc/redhat-release
CentOS Linux release 7.2.1511 (Core)
 
本文永久更新地址:http://www.linuxdiyf.com/linux/24378.html