安装docker依赖包
yum install -y yum-utils \ device-mapper-persistent-data \ lvm2
添加yum软件源
yum-config-manager \ --add-repo \ https://mirrors.ustc.edu.cn/docker-ce/linux/centos/docker-ce.repo
安装 Docker CE
yum makecache fast
yum install docker-ce
使用脚本自动安装
curl -fsSL get.docker.com -o get-docker.sh
sh get-docker.sh --mirror Aliyun
启动docker
systemctl enable docker
systemctl start docker
添加用户组
groupadd docker
usermod -aG docker $USER
测试是否安装成功
docker run hello-world