1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
| cd /etc/yum.repos.d/ #官方源 wget https://download.docker.com/linux/centos/docker-ce.repo wget https://mirrors.tuna.tsinghua.edu.cn/docker-ce/linux/centos/docker-ce.repo #替换清华源 sed -i 's@https://download.docker.com@https://mirrors.tuna.tsinghua.edu.cn/docker-ce@g' docker-ce.repo #安装docker-ce yum install docker-ce -y #镜像加速 cat >> /etc/docker/daemon.json <<EOF { "registry-mirrors": ["https://guxaj7v7.mirror.aliyuncs.com","https://registry.docker-cn.com"] } EOF #启动服务 systemctl enable docker systemctl start docker #查看版本信息 docker version docker info
|