安装docker
https://www.runoob.com/docker/centos-docker-install.html
centos8默认使用podman代替docker 直接安装docker会出现以下错误
解决办法,命令后追加 –allowerasing
yum install docker-ce docker-ce-cli containerd.io --allowerasing
或者先卸载podman
yum erase podman buildah
#安装工具
yum install -y yum-utils device-mapper-persistent-data lvm2
#设置源
yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
#安装社区版
yum install docker-ce docker-ce-cli containerd.io
systemctl start docker
systemctl enable docker
#卸载
yum remove docker-ce
安装 docker-compose
sudo curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo curl -L "https://github.com/docker/compose/releases/download/v2.2.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo curl -L "https://github.com/docker/compose/releases/download/v2.2.3/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
要安装其他版本的 Compose,请替换 1.24.1 https://github.com/docker/compose/releases
#设置权限
sudo chmod +x /usr/local/bin/docker-compose