compose-spec / compose-go

Reference library for parsing and loading Compose YAML files

Home Page:https://compose-spec.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

docker-compose with volume paths relative to respective config file paths

kaninaba94 opened this issue · comments

The issue is that all relative volume paths are resolved to the location of the first given config file instead of the config file they are specified in. It would make sense to introduce a flag or an environment variable that changes this behavior.

See this issue in docker/compose

That would make sense when project directory is inferred from first file in the list, but how would this behave when user declares an explicit project directory with docker compose -p /foo ?

I'd prefer we introduce support for an explicit path notation to be "relative to current compose file", in addition to the existing ./foo for project-directory relative paths, and ~/bar for user HOME relative paths. Any suggestion for a portable and human-friendly syntax is welcome :)

I wonder we could adopt __DIR__ variable used by PHP as "folder of the current file". I don't know another comparable example we could get inspiration for regarding syntax