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

support volume mapping into the home of a container #885

Closed
wants to merge 1 commit into from

Conversation

maurerle
Copy link
Contributor

@maurerle maurerle commented Mar 9, 2024

It is supported in docker compose to have a volume mapping like /foo:~/data which should also be supported by podman compose.

This PR allows using this too.

@p12tic
Copy link
Collaborator

p12tic commented Mar 9, 2024

@maurerle Thanks for the PR. Is tilde volume mapping specified in the compose spec? I couldn't find it.

Copy link
Collaborator

@p12tic p12tic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR, it looks good.

This will need unit tests for the parse_short_mount() function. But before spending time on these let's wait for me to understand what part of compose spec or undocumented docker compose behavior we are dealing with.

@maurerle
Copy link
Contributor Author

maurerle commented Mar 9, 2024

I think that this is not documented here:
https://github.com/compose-spec/compose-spec/blob/master/07-volumes.md

It just says that the destination can be a part inside the docker container - so any valid unix path would be fine, including those starting with a tilde ~
If it does not start with an absolute path - say plain data, docker compose says invalid mount path: 'data' mount path must be absolute - so ~ is interpreted as a valid absolute path..

@p12tic
Copy link
Collaborator

p12tic commented Mar 9, 2024

OK, replicating undocumented behavior is fine. I was just concerned that this is documented in the spec but I can't find it.

@maurerle
Copy link
Contributor Author

I don't know what happened but somehow this does not work with docker compose either.. ~/data:rw': invalid mount config for type "bind": invalid mount path: '~/data' mount path must be absolute
Weird - problem some wrong assumptions i had when testing before..
Sorry for that.

@maurerle maurerle closed this Mar 12, 2024
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

Successfully merging this pull request may close these issues.

2 participants