操作系统:Centos 7.9 root环境
如果你先前的操作系统安装了Docker环境,请卸载 Docker 相关的软件包,没有则忽略这一步。
yum remove docker \
docker-client \
docker-client-latest \
docker-common \
docker-latest \
docker-latest-logrotate \
docker-logrotate \
docker-engine
yum install -y yum-utils
yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
yum install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
这将会下载最新的Docker版本
systemctl enable docker
systemctl start docker ## 启动Docker
systemctl stop docker ## 关闭Docker
docker -v
yum install curl
可以去github选择版本 https://github.com/docker/compose/releases[/t-primary
curl -L "https://github.com/docker/compose/releases/download/1.29.1/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
如果这里下载慢可以去github上下载之后传到服务器/usr/local/bin/上即可
chmod +x /usr/local/bin/docker-compose
docker-compose -v