Docker 安装

1)关闭centos7下的firewalld服务并安装iptables-services

[root@localhost~]# systemctl disable firewalld

rm'/etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service'

rm'/etc/systemd/system/basic.target.wants/firewalld.service'

[root@localhost~]# yum -y install iptables-services

 

2)开启iptables服务

[root@localhost~]# systemctl enable iptables

ln-s '/usr/lib/systemd/system/iptables.service''/etc/systemd/system/basic.target.wants/iptables.service'

[root@localhost~]# systemctl start iptables

 

3)删除非官方的Docker包

yum list installed | grep docker(检查当前的os,是否安装了docker

3.1) yum -y remove docker。。。 删除已安装的内容

     rm –rf /var/lib/docker

 

3.2)  使用下边的命令设置最新稳定版的docker仓库(如果之前没装过,从3.2开始)

输入命令:yum-config-manager    --add-repo https://docs.docker.com/v1.13/engine/installation/linux/repo_files/centos/docker.repo

 

3.3)安装Docker

yum -y install docker

二、启动docker服务并设置开机自动启动

[root@localhost~]# systemctl start docker.service

[root@localhost~]# systemctl enable docker.service

开机启动:  chkconfig docker on

三、测试:

   docker info

   docker -v

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值