containers / podman-compose

a script to run docker-compose.yml using podman
GNU General Public License v2.0
5.01k stars 477 forks source link

support volume mapping into the home of a container #885

Closed maurerle closed 6 months ago

maurerle commented 7 months ago

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 commented 7 months ago

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

maurerle commented 7 months ago

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 commented 7 months ago

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

maurerle commented 6 months ago

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.