-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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 mounting changes owner of existing directory #10776
Comments
I think that's all right only if the directory is not yet existing in the image. |
Care to open a PR for this. Basically you believe that the destination directory in an image should match the existing directory UID/GID/Permissions if a named volume is created and mounted on the container. I thought I had a similar bug like this and fixed it. but maybe not. |
For more context we need this to use The tool spawns container that is running as a |
Yes this makes total sense that it should work this way. |
To play a devil advocate here, the manpage of mount(8) says:
That's why if the first command is run as user All this can be avoided by calling run with proper user for each time:
It seems that, Podman closer mimics the standard Despite this, I think Podman should follow Docker in his behavior, as it's marketed as a Docker drop-in replacement. |
I think the patches from @rhatdan may have changed the behavior on main - @matejvasek are you testing with the latest code? @cardil Unfortunately, while I tend to agree with you, our compatibility promise with Docker means we are largely tied to their decisions, including bad ones. As @rhatdan says - "Bug for bug compatible" |
@mheon What patches? I run code from |
They're already merged (I just backported them for 3.2.2), so if master is broken, the issue isn't fixed. |
I fixed the permissions, but not the ownership, I guess. |
I had thought that it already worked. |
@rhatdan @mheon I tried to hackaround this in our software by creating the volume in advance. I am doing something like There is an issues with this approach: The thing is that for Even if I fix the problem above there is another problem: |
That chown is probably deliberate but that's not what docker does. |
@rhatdan can you give me some pointer where to fix this? |
This should fix the problem, you can grab it and add tests, if you want.
|
podman
volume mounting doesn't preserve original directory owner. it changes owner to user that is currently running the container.docker
preserves the original owner.The text was updated successfully, but these errors were encountered: