Docker 安装 Compose 插件
安装Compose 插件之前必须已经安装了 Docker!
1.使用存储库安装
1.设置存储库【使用存储库安装的Docker,此步骤可省略】
yum install -y yum-utils yum-config-manager \ --add-repo \ https://download.docker.com/linux/centos/docker-ce.repo
2.安装或更新Compose 插件
yum update yum install docker-compose-plugin
2.手动安装
1.为当前用户安装
1.下载并安装
DOCKER_CONFIG=${DOCKER_CONFIG:-$HOME/.docker} mkdir -p $DOCKER_CONFIG/cli-plugins curl -SL https://github.com/docker/compose/releases/download/v2.13.0/docker-compose-linux-x86_64 -o $DOCKER_CONFIG/cli-plugins/docker-compose
2.对二进制文件应用可执行权限
chmod +x $DOCKER_CONFIG/cli-plugins/docker-compose
2.为所有用户安装
1.下载并安装
curl -SL https://github.com/docker/compose/releases/download/v2.13.0/docker-compose-linux-x86_64 -o /usr/local/lib/docker/cli-plugins/docker-compose
2.对二进制文件应用可执行权限
sudo chmod +x /usr/local/lib/docker/cli-plugins/docker-compose
3.测试安装。
docker compose version