我有一个 docker-compose 项目,其容器配置位于如下子目录中
.
├── a.yml
└── b
└── b.yml
a.yml 是
version: "2.2"
services:
a:
build:
context: ./
b.yml 是
version: "2.2"
services:
b:
build:
context: ./
COMPOSE_FILE=a.yml:b/b.yml
docker-compose config
结果是
services:
a:
build:
context: /Volumes/Disk/Development/spaces/docker/docker-compose-relative-path
b:
build:
context: /Volumes/Disk/Development/spaces/docker/docker-compose-relative-path
version: '2.2'
根据https://docs.docker.com/compose/compose-file/compose-file-v2/#context上下文路径应该是相对的,但似乎不是!对于服务 b,它应该是/Volumes/Disk/Development/spaces/docker/docker-compose-relative-path/b
。这被认为是错误还是文档中的一个缺陷?