#!/bin/bash #删除已安装的Docker sudo yum -y remove docker \ docker-client \ docker-client-latest \ docker-common \ docker-latest \ docker-latest-logrotate \ docker-logrotate \ docker-selinux \ docker-engine-selinux \ docker-engine #配置阿里云Docker Yum源 sudo yum install -y yum-utils device-mapper-persistent-data lvm2 sudo yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo sleep 10 #安装指定版本 sudo yum install docker-ce -y sleep 10 #修改镜像加速 sudo mkdir -p /etc/docker sudo tee /etc/docker/daemon.json <<-'EOF' { "registry-mirrors": ["https://x0nc0f5n.mirror.aliyuncs.com"] } EOF sudo systemctl daemon-reload sudo systemctl restart docker sleep 2 docker version
标签:sudo,ce,yum,docker,安装,latest From: https://www.cnblogs.com/luochunxi/p/16737953.html