centos6.x安装:
#wget http://mirrors.ustc.edu.cn/fedora/epel/6/i386/epel-release-6-8.noarch.rpm#wget http://mirrors.ustc.edu.cn/fedora/epel/6/x86_64/epel-release-6-8.noarch.rpm#wget http://mirrors.ustc.edu.cn/fedora/epel/7/x86_64/e/epel-release-7-5.noarch.rpm#或者在这里找相应的epel文件http://mirrors.ustc.edu.cn/fedora/epel/
#---------------------------------------------
yum install docker-io
usermod -G docker $USERservice docker start chkconfig docker on#docker 下载centos镜像docker pull centos #下载centos所有的镜像docker pull centos:centos6 下载centos6镜像#docker 下ubutu镜像包:
docker pull ubuntu #下载ubuntu所有的镜像docker pull ubuntu:14.10 下载ubuntu14.10镜像#查看本机所有的镜像包:
docker images#docker运行镜像:
docker run -it centos /bin/bash docker run -it centos:centos6 /bin/bash echo 'hello jk409!'在镜像里输入exit,就退出并停止运行
#docker构建新的镜像:
docker build -t centos6:memcached ./memcached #./memcached目录下有Dockerfile文件#docker运行新的镜像:
docker run -d -p 11211:11211 centos6:memcached#docker停止后台运行的镜像
docker stop/kill (container_id)#docker stop `docker ps|grep memcached |awk { 'print $1'}`