Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
kaninaba94 opened this issue Dec 27, 2022 · 2 comments

Comments

@kaninaba94
Copy link

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

@ndeloof
Copy link
Collaborator

ndeloof commented Apr 14, 2023

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 :)

@ndeloof
Copy link
Collaborator

ndeloof commented Jan 30, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants