-
We have a web interface that allows users to schedule batch jobs on a server, and it will chown files created so they are owned by the user that submitted the batch job. Right now it runs as a systemd service, and we have it set to run as a non-root user with CAP_CHOWN added to AmbientCapabilities so the service user can chown the files. We're trying to containerize all the services in the interface so it stops breaking when the admin updates the system, and I have the chown working fine in a container created as root and ran in Podman by root. However, I'm trying to set it to run as a non-root user (usually with the -u flag in podman run, although I've tried other things as well) with CAP_CHOWN capabilities to modify the owner of files in a bind mounted directory, but it always fails at the chown command with an "Operation not permitted" error. Tried running setcap commands when building the container in Buildah, tried --cap-add and --privileged flags when running in Podman, can't get it to work any time I try to make the user someone other than root. Is it possible to run the container as a non-root and give it CAP_CHOWN on bind-mounted directories? How would I need to configure this, both when building the container and when running it? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 7 replies
-
Can you give us a simple repeater to play with? |
Beta Was this translation helpful? Give feedback.
-
You are using an ancient version of Podman on RHEL7 is there anyway to move this to RHEL8 (Or even better RHEL9) so you could use a more recent version of Podman? To diagnose the issue, first I would |
Beta Was this translation helpful? Give feedback.
-
Let's simplify, this might be something that was fixed in newer versions of podman.
|
Beta Was this translation helpful? Give feedback.
Let's simplify, this might be something that was fixed in newer versions of podman.