官方文档:https://docs.docker.com/compose/compose-file/compose-file-v3
下载地址:https://docs.docker.com/compose/install/

https://www.yii666.com/blog/449494.html

入门文档:
https://www.runoob.com/docker/docker-compose.html

方式一:GitHub官方下载安装(推荐,速度慢但不会出错)
1.GitHub官方下载(如果在线下载不了,可以直接下载后上传)
https://github.com/docker/compose/releases


curl -SL https://github.com/docker/compose/releases/download/v2.17.2/docker-compose-linux-x86_64 -o /usr/local/bin/docker-compose

curl -SL https://github.com/docker/compose/releases/download/v2.20.3/docker-compose-linux-aarch64 -o /usr/local/bin/docker-compose

要安装其他版本的 Compose,请替换 v2.17.2。
Docker Compose和Docker版本对应关系:
https://docs.docker.com/compose/compose-file/compose-file-v3/

Docker Compose下载地址:
https://github.com/docker/compose/releases

2.赋予执行权限:

sudo chmod +x /usr/local/bin/docker-compose

3.建立软连接:

sudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose

4.查看docker版本:

docker-compose --version

  1. dockerfile

version: "3.8"
services:
  webapp:
    build:
      context: ./dir
      dockerfile: Dockerfile-alternate
      args:
        buildno: 1
文档更新时间: 2024-05-12 23:35   作者:admin