1.关闭selinux
[root@localhost ~]#setenforce 0
2.安装 Fedora EPEL
[root@localhost ~]#
yum install -y http://ftp.riken.jp/Linux/fedora/epel/6/x86_64/epel-release-6-8.noarch.rpm
3.安装docker
[root@localhost ~]#yum install -y docker-io
[root@localhost ~]#yum install -y docker
4.下载官方镜像
[root@localhost ~]#docker pull centos
5.查看安装好的虚拟机
[root@localhost ~]#docker images
6.进入安装的虚拟机
docker run -i -t centos /bin/bash
7.exit退出
8.查找centos版本
docker search centos
9.安装6.4虚拟机
docker pull gpmidi/centos-6.4
10.进入新安装的6.4虚拟机
docker run -i -t gpmidi/centos-6.4 /bin/bash
11.创建一个文件夹
bash-4.1# mkdir xieping
12.exit退出
13.保存镜像
[root@localhost ~]# docker ps -a
[root@localhost ~]# docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
773d9abe1086 gpmidi/centos-6.4:latest /bin/bash 2 minutes ago Exited (130) 12 seconds ago naughty_hopper7
22d18ec7c779 e0463385c799 /bin/bash 2 minutes ago Exited (0) 2 minutes ago happy_mayer1
里面的信息会告诉你用的系统最近是几分钟前使用的,然后记住对应CONTAINER ID,然后退出
14.把ID提交到仓库中
docker commit 773d9abe1086 gpmidi/centos-6.4
15.下次进入就有你保存的信息了
未完待续
本文出自 “xieping_linux” 博客,请务必保留此出处http://xieping.blog.51cto.com/3715452/1439633
centos7抢先安装docker1.0,布布扣,bubuko.com
原文地址:http://xieping.blog.51cto.com/3715452/1439633