Featured image of post Docker 安装 Compose

Docker 安装 Compose

不知道为啥官方文档介绍的这么乱

尝试过全局安装,但是并没有成功,最后还是仅本用户安装了。

安装

  1. 创建目录
1
mkdir -p ~/.docker/cli-plugins
  1. 下载二进制文件
1
curl -L https://ghproxy.com/https://github.com/docker/compose/releases/latest/download/docker-compose-`uname -s`-`uname -m` > ~/.docker/cli-plugins/docker-compose
  1. 添加可执行权限
1
chmod +x ~/.docker/cli-plugins/docker-compose
  1. 测试是否安装成功
1
2
docker compose version
# Docker Compose version v2.21.0

参考资料

Linux 安装 docker compose v2
docker/compose: Define and run multi-container applications with Docker

Licensed under CC BY-NC-SA 4.0
Built with Hugo
主题 StackJimmy 设计