-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Mounted volumes owned by root rather than container user #20077
Comments
Podman on MAC currently does not support chowning the container, because it is built on PLAN9 file system for volume support. Podman is moving to Apple Native virtualization, hopefully in the next release 4.8. Which uses virtiofsd for its volumes, and I believe this supports chowning of files. You can futz around with the --userns flag on podman to set the default user of the container to match your host user, which should eliminate the chown.
|
@baude WDYT? |
A friendly reminder that this issue had no activity for 30 days. |
This is not MacOS-only issue, I think I am able to reproduce on Fedora 40:
|
Docker is running a rootful container, while Podman is running a rootless container. In both cases the actual UID of the data directory is 1000, But in the podman case you are runing within a user namespace with UID 1000 mapped to UID 0, which is why it looks like the file is owned by root. To see the same behaviour as Docker, you could run $ sudo podman run -v $HOME/neo4j/data:/data --entrypoint /bin/bash neo4j:latest -c "ls -lad /data; whoami" If you ran Docker in rootless mode, you would see the same thing. |
To play with User namespace try $ podman unshare You will see all of the files owned by UID 1000 are now listed as owned by root. Take a look at my book Podman in Action for full description of User Namespace. |
Issue Description
On MacOS (at least), volume mounts appear to be owned by
root
when running containers (such as neo4j) which run as a non-root user and attempt to create/chown files.With
podman
:With
docker
:Two differences I notice:
podman
directory is owned bynogroup
rather than byroot
.podman
directory listing has a differenttotal
number of entries (0 vs 4)Steps to reproduce the issue
Steps to reproduce the issue
(See the issue description)
podman run -v $HOME/neo4j/data:/data neo4j:latest
podman
, but succeeds on Docker DesktopDescribe the results you received
Running under
podman
:Describe the results you expected
Running under
docker
:podman info output
The text was updated successfully, but these errors were encountered: