一、安装
1.安装前依赖安装
1 yum -y install gcc gcc-c++ yum-utils device-mapper-persistent-data lvm2
2.卸载旧版docker
1 $ sudo yum remove docker docker-client docker-client-latest docker-common docker-latest docker-latest-logrotate docker-logrotate docker-engine
3.设置yum源
yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
4.yum安装docker
yum install docker-ce
5.启动docker并设置开机自启
sudo systemctl start docker sudo systemctl enable docker
6.查看docker版本
[root@centos702 23:14:47]:/root #docker version Client: Docker Engine - Community Version: 19.03.4 API version: 1.40 Go version: go1.12.10 Git commit: 9013bf583a Built: Fri Oct 18 15:52:22 2019 OS/Arch: linux/amd64 Experimental: false Server: Docker Engine - Community Engine: Version: 19.03.4 API version: 1.40 (minimum version 1.12) Go version: go1.12.10 Git commit: 9013bf583a Built: Fri Oct 18 15:50:54 2019 OS/Arch: linux/amd64 Experimental: false containerd: Version: 1.2.10 GitCommit: b34a5c8af56e510852c35414db4c1f4fa6172339 runc: Version: 1.0.0-rc8+dev GitCommit: 3e425f80a8c931f88e6d94a8c831b9d5aa481657 docker-init: Version: 0.18.0 GitCommit: fec3683