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
Compose does not mount volume if I use relative path #9191
Comments
What I noticed, that if I use relative path, then it looks like:
But when I use absolute path, then:
So this is some problem with permissions |
If I use relative path without named volumes then also all works fine:
Permissions are next:
Here, despite folder is |
This is expected: as you define volume driver option, those aren't processed by docker compose but passed to docker engine, and this one won't accept relative path (as there's no "working directory" in this context on engine side) You don't have to declare a volume to bind mount a local path, just use : volumes:
- ./data/grafana:/var/lib/grafana |
I want to give name because want to see normal names when listing:
If I do not give name I get:
And this is unreadable =( @ndeloof: So before passing to docker engine please expand relative path to full |
I don't think we want to include volume driver-specific code into docker-compose Seems to me you get some confusion between volumes and bind-mount. While "local" driver allows you do do such a hack, a volume should be an abstract storage, so not declared with a local path. Either you want a volume (abstract) or you want to mount some local files, and then obviously |
I want to see readable names for mounts/volumes. I use here |
I got your point, but that's basically a corner-case we don't want to support. volumes:
chimera-grafana-data:
driver: local
driver_opts:
type: 'none'
o: 'bind'
device: '${PWD}/data/grafana' |
Well, this was supported in the tool chain The workaround is OK and it works for me, but be aware that it breaks if you aren't in the same folder like your config and point to it with |
Relative path was actually supported with the legacy |
Considering docker compose V1 had dedicated code for this use case, I've proposed a fix: compose-spec/compose-go#332 |
Description
I think this is related to: #3715
When I use relative path at configuration it does not work, but if I use absolute path, then everything is OK
Steps to reproduce the issue:
Working compose file:
Describe the results you received:
Describe the results you expected:
Additional information you deem important (e.g. issue happens only occasionally):
Output of
docker compose version
:Output of
docker info
:Additional environment details:
The text was updated successfully, but these errors were encountered: