-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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
Reviving #6343 as it looks like the fix wasn't migrated to v2 #9410
Comments
The ui:
driver_opts:
type: none
o: bind
device: ${PWD}/../../../../../app/asset/html |
@JMLX42 $PWD workaround is still not cross-platform. |
interesting. Would make sense anyway... maybe we can just add some custom code for this purpose in docker/compose, wdyt @glours @ulyssessouza ? |
I don't think resolving paths client-side makes sense, it broke my setup in v1, causing #7900. I suppose its fine if you are using a local docker client & server, but if you have a remote server, then you're working with two distinct filesystems. |
I uncovered this issue when looking at docker-compose as a devops solution for our cross-platform team. This significantly complicates the use of compose as a tool for cross-platform devops. I'm only seeing this issue on Windows, but relative paths seem to resolve for MacOS (M1) and WSL2 for us. |
Any updates on this topic? |
This was indeed the original reason for not resolving relative paths on the client side; docker (and docker compose) use a client-server approach, and while there's many scenarios where the daemon host (from where things are actually mounted) and CLI are on the same machine, there's also many setups where that's not the case. That said; for the upcoming v23.0.0 release (currenty in "rc"), changes were made in the CLI to treat When using compose-files, there's still some ambiguity when using multiple compose files; something like compose-spec/compose-spec#248 would take the ambiguity away. |
This has been fixed by compose-spec/compose-go#332 |
Does not seem to be fixed for me (see #6343 (comment)). |
Hello @ndeloof, I've just tested it in 2.15.1 (it does depend on compose-go v. 1.8.2) with "short" bind syntax, and I've got |
The issue in ticket (#6343) which was resolved in PR (#7762) appears to have been revived in docker-compose v2. To restate the issue, the driver_opts device parameter in volume configuration does not allow relative paths. I have tested it on docker-compose v2.3.3 and v.2.4.1 on Linux and WSL.
The fix was implemented as (https://github.com/docker/compose/blob/master/compose/config/config.py#L497) where relative paths were resolved to absolute paths before further usage.
I suspect that the relevant volume configuration in compose v2 is implemented here (https://github.com/docker/compose/blob/v2/pkg/compose/create.go#L1115) where we are passing the volume configuration as it is to docker client. This ends up creating volumes with relative paths that don't work. We need to implement the same fix as implemented previously, and resolve the paths to absolute paths before passing to docker client.
The text was updated successfully, but these errors were encountered: