安装yum-util,yum-utils是yum的工具包集合,由不同的作者开发,使yum使用起来更加方便和强大
yum -y install yum-utils
2.
使用yum-config-manager命令,设置Docker仓库,之后,您可以从仓库安装和更新 Docker
yum-config-manager \ --add-repo \http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
3.
生成索引缓存索引
yum makecache fast
安装docker
yum -y install docker-ce docker-ce-cli containerd.io
5.
设置开机自启
systemctl daemon-reload
systemctl start docker
systemctl enable docker
curl -L "https://get.daocloud.io/docker/compose/releases/download/1.27.3/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
7.
chmod +x /usr/local/bin/docker-compose
docker-compose version