yum 安装docker以及docker-compose的配置使用
1.删除旧版本docker
sudo yum remove docker \ docker-client \ docker-client-latest \ docker-common \ docker-latest \ docker-latest-logrotate \ docker-logrotate \ docker-engine
2.设置docker的yum源repository
sudo yum install -y yum-utils sudo yum-config-manager \ --add-repo \ https://download.docker.com/linux/centos/docker-ce.repo
3.安装最新docker
sudo yum install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
4.启动docker
sudo systemctl start docker
sudo systemctl enable docker
5.下载docker-compose,可以根据情况变更版本号
sudo curl -L https://github.com/docker/compose/releases/download/v2.17.2/docker-compose-linux-x86_64 -o /usr/local/bin/docker-compose
6.设置docker-composed的权限
cd /usr/local/bin/ chmod u+x docker-composed
7.执行docker-composed.yml,注意与yml处于同一目录
docker-compose version
docker-compose up -d