centos7/ubuntu下部署docker-ce

2020-03-24  本文已影响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  #设置开机自动启动

到此,安装完毕啦

上一篇 下一篇

猜你喜欢

热点阅读