Docker Compose v2 安装
1. 官网安装地址
https://docs.docker.com/compose/cli-command/
2. 设置环境变量
DOCKER_CONFIG=${DOCKER_CONFIG:-$HOME/.docker}
3. 创建存放目录
mkdir -p $DOCKER_CONFIG/cli-plugins
4. 下载文件
curl -SL https://github.com/docker/compose/releases/download/v2.2.3/docker-compose-linux-x86_64 -o $DOCKER_CONFIG/cli-plugins/docker-compose
# 可替换为国内地址
curl -SL https://get.daocloud.io/docker/compose/releases/download/v2.2.3/docker-compose-`uname -s`-`uname -m` -o $DOCKER_CONFIG/cli-plugins/docker-compose
5. 修改执行权限
chmod +x $DOCKER_CONFIG/cli-plugins/docker-compose
6. 测试是否成功
docker compose version
评论区