centos7 安装 docker-compose
The new Compose V2, which supports the
compose
command as part of the Docker CLI, is now available.Compose V2 integrates compose functions into the Docker platform, continuing to support most of the previousdocker-compose
features and flags. You can test the Compose V2 by simply replacing the dash (-
) with a space, and by runningdocker compose
, instead ofdocker-compose
.
新的 Compose V2 支持将 compose 命令作为 Docker CLI 的一部分,现已推出。Compose V2 将 compose 功能集成到 Docker 平台中,继续支持之前的大部分 docker-compose 功能和标志。 您可以通过简单地将破折号 (-) 替换为空格并运行 docker compose 而不是 docker-compose 来测试 Compose V2。
也就是新的 compose 被集成到了 docker cli 里。
新版本的安装
使用镜像加速,比较快
DOCKER_CONFIG=${DOCKER_CONFIG:-$HOME/.docker}
mkdir -p $DOCKER_CONFIG/cli-plugins
curl -SL https://ghproxy.com/https://github.com/docker/compose/releases/download/v2.5.0/docker-compose-linux-x86_64 -o $DOCKER_CONFIG/cli-plugins/docker-compose
旧版本的安装
使用镜像加速,比较快
curl -SL https://ghproxy.com/https://github.com/docker/compose/releases/download/v2.5.0/docker-compose-linux-x86_64 -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
官网安装方法 https://docs.docker.com/compose/install/
github 仓库地址 https://github.com/docker/compose/releases
下载加速网址