美文网首页
centos7/ubuntu下部署docker-ce

centos7/ubuntu下部署docker-ce

作者: 草样年华灬 | 来源:发表于2020-03-24 22:16 被阅读0次

系统:centos7.x

centos6.x下安装见 https://www.jianshu.com/p/170cbcc08f49`

1. 清理旧版,如果是新安装跳过即可

#清理防火墙和虚拟网卡
iptables -t nat -F 
ip link set docker0 down 
ip link delete docker0

# 卸载旧版本docker
yum remove docker docker-common container-selinux docker-selinux docker-engine

2. 安装docker(使用了aliyun源)

1 centos7.x系统

yum install -y yum-utils #
yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
yum makecache fast   #不是必须的
yum  install docker-ce -y

2 Ubuntu系统

add-apt-repository "deb [arch=amd64] http://mirrors.aliyun.com/docker-ce/linux/ubuntu $(lsb_release -cs) stable"
curl -fsSL http://mirrors.aliyun.com/docker-ce/linux/ubuntu/gpg | apt-key add -
apt-get install docker-ce

3. 启动docker 服务

systemctl start docker      #启动
systemctl enable docker  #设置开机自动启动

到此,安装完毕啦

相关文章

网友评论

      本文标题:centos7/ubuntu下部署docker-ce

      本文链接:https://www.haomeiwen.com/subject/rbtzyhtx.html