Rootless container on RHEL9 #114
Swallowtail23
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
On a new server I tried running as I have before as root, and had strange issues with firewall interactions and permissions issues when the container was trying to start running. Reading more I found the recommendations to run rootless, so this is how I have achieved that.
Note that this is with podman on RHEL9
loginctl enable-linger upb
. This means that processes started by the user run even if that user is not logged on.podman create ghcr.io/ep1cman/unifi-protect-backup:0.10.1
chown -R upb:upb /opt/upb-docker
, although note (see later) that when the container runs it takes over the permissions to the directories provided in the config filepodman container rename 797a572a7de8 upb-0.10.1
(replacing 797a572a7de8 with yours)podman generate systemd --name upb-0.10.1 > /opt/upb-docker/upb-0.10.1.service
systemctl --user enable /opt/upb-docker/upb-0.10.1.service
systemctl --user start upb
systemctl --user -M upb@ restart upb
(or stop, start, etc.)Those permissions (166446:166536) are an area I don't know much about, but I think it's the way that podman maps internal permissions to the system's permissions.
Note that when you draw down a new image, you will need to (logged on as the upb user)
systemctl --user disable upb.service --now
to remove the existing service before re-doing the systemd/systemctl process above.I also then do a
ln -s
to /var/log to the container's log file, which is located in a subfolder of/home/upb/.local/share/containers/storage/overlay-containers/
I think that's it for now!
Beta Was this translation helpful? Give feedback.
All reactions