docker安装(centos6.5_x86_64)

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  $USER
service  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'}`

转载于:https://my.oschina.net/jk409/blog/308925

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值