-
Notifications
You must be signed in to change notification settings - Fork 5.2k
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
volume driver_opts device does not allow relative paths #6343
Comments
I agree this would be nice and could save some head-scratching. The current functionality (driver options passed through directly to drivers) is documented, although it took me a little while to find it. The consistency and ease of use might be worth the addition of path expansion logic. |
Same problem in Ubuntu 18.04 with docker compose version
docker-compose.yml
|
Same problem:
|
http://blog.code4hire.com/2018/06/define-named-volume-with-host-mount-in-the-docker-compose-file/ Sorry, my English is very bad. |
Thanks for the blog post, all efforts are helpful. I though think the point of the ticket remains to request that docker-compose should do all this bending-over-backwards for the user. I mean it does exactly this in other places determining the relative path regardless of operating system without the need for squirrelly custom environmental variables. To my knowledge compose does not do anything we could not script out step-by-step on our own were we so inclined. Rather we use compose cause it makes complicated things easier and simpler to execute. This request is that compose "do its thing" for the bind device pointer and allow us to provide relative paths that compose then converts to an absolute address internally. That would be swell. |
I achieved this a while back using the native "$PWD" variable (Linux & Mac). This does not require a custom environment file. So it can be easily achieved using the below syntax. I agree though that they should conform with the other bind syntax and allow for your example. In the meantime, this works well.
Edit: I believe ${PWD} will work cross-platform, but I don't have a windows docker environment to test this. Hopefully, this helps someone else. |
Sadly the windows powershell equivalent is lower case $pwd and the equivalent in windows command shell would be the cd command. Those details are generally why we'd want docker-compose to handle this for us. I mean compose already has the logic to know where things are at for other options that take a dot, so the request here to just expand that to the device option. |
I'm dearly, dearly missing this option. It's hard to handle a lot of volumes if they can't be named, and |
Guys, what's the reason to not implement relative paths for named volumes? I'm very surprised about this problem. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
This issue has been automatically closed because it had not recent activity during the stale period. |
This feature must be implemented cause there is no alternatives. |
It's 2020 and this issue from 2018 still persists. How do we reopen it? |
@aiordache What do you think? @Eluminae concerns here seems very reasonable. there is no real alternatives. |
nice to have this feature |
Could we maybe reopen this? |
My minimal reproducible case: This works
This does not work:
|
@tomasfejfar v2.13.0 is obsolete, please upgrade just tested, works for me with v2.17.3
|
Docker-compose allows relative paths for most volume commands but does not support such paths when used under driver_opts device
Output of
docker-compose version
Output of
docker version
Output of
docker-compose config
(Make sure to add the relevant
-f
and other flags)Steps to reproduce the issue
providing a full path using /c/ notation corrects the problem.
Expected result
Compose should determine the proper path using the same expansion ;ogic as done for the usual bind mount relative paths.
The text was updated successfully, but these errors were encountered: