--volume
with idmap
copies with wrong owner/group
#23467
Labels
kind/bug
Categorizes issue or PR as related to a bug.
locked - please file new issue/PR
Assist humans wanting to comment on an old issue or PR with locked comments.
Issue Description
If you use a volume which doesn't exist, podman will copy files from the underlying filesystem into the newly created volume. The documentation doesn't seem very clear about this but this is enabled by default.
The issue is, that when you also enable
idmap
on the volume, and your container runs with--userns=auto
, then the copied files are owned by the temporary uid/gid.Steps to reproduce the issue
Steps to reproduce the issue
tmp
does not existpodman run --rm -it --userns auto --volume tmp:/etc:idmap alpine:3.20 ls -lahn /etc/
ls -lahn /var/lib/containers/storage/volumes/tmp/_data/
Describe the results you received
For Step 2, all files are owned by 65534:65534 (nobody/nogroup) within the container.
For Step 3, all files are owned by a dynamic ID outside the container.
Describe the results you expected
For Step 2, all files are owned by 0:0 (root/root) within the container.
For Step 3, all files are owned by 0:0 (root/root) outside the container.
podman info output
Podman in a container
No
Privileged Or Rootless
Privileged
Upstream Latest Release
Yes
Additional environment details
As you can see in
podman info
, you can see that I'm running stable fedora coreOS with a newer kernel (6.11-rc1). I did that because I use very recent rk3588 hw, but the issue was also present on the kernel which is shipped with that version of fedora).Additional information
Additional information like issue happens only occasionally or issue happens with a particular architecture or on a particular setting
The text was updated successfully, but these errors were encountered: