使用阿里云镜像安装Docker

1 卸载已安装Docker组件(如果没有安装过Dokcer,跳过这一步)

yum remove -y docker-ce \
			  docker-client \
			  docker-client-latest \
			  docker-common \
			  docker-latest \
			  docker-latest-logrotate \
			  docker-logrotate \
			  docker-engine 

2  安装yum软件包

yum install -y yum-utils

3 设置阿里云镜像仓库

yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo

4 更新软件包索引

yum makecache fast

5 安装Docker CE

yum install docker-ce docker-ce-cli containerd.io

6 启动Docker

systemctl start docker

7 查看Docker 版本

docker version

结果如下正常:

[root@localhost ~]# docker version
Client: Docker Engine - Community
 Version:           19.03.12
 API version:       1.40
 Go version:        go1.13.10
 Git commit:        48a66213fe
 Built:             Mon Jun 22 15:46:54 2020
 OS/Arch:           linux/amd64
 Experimental:      false

Server: Docker Engine - Community
 Engine:
  Version:          19.03.12
  API version:      1.40 (minimum version 1.12)
  Go version:       go1.13.10
  Git commit:       48a66213fe
  Built:            Mon Jun 22 15:45:28 2020
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.2.13
  GitCommit:        7ad184331fa3e55e52b890ea95e65ba581ae3429
 runc:
  Version:          1.0.0-rc10
  GitCommit:        dc9208a3303feef5b3839f4323d9beb36df0a9dd
 docker-init:
  Version:          0.18.0
  GitCommit:        fec3683

参考https://docs.docker.com/

你可能感兴趣的:(服务器后端)