$darkmode
Elektra 0.11.0
|
Podman is an alternative container engine which does not require root privileges on the host OS.
Podman aims at being compatible with Docker and in most cases simply replacing docker
by podman
is enough.
However, there are some notable differences when running containers themselves as a user other than root.
Anyone who uses Podman to run their containers.
To build the Debian bullseye container with Docker the command is
Simply replacing docker
with podman
works in this case
One area where Podman notably differs from Docker is when interacting with the filesystem of the host.
This is relevant when mounting directories of the host filesystem as volumes.
With Docker the container engine itself runs as a priviledged process and therefore the permissions in the host OS are not relevant.
With Podman the situation is more involved, as the container engine does not run with root priviledges.
For instance, the containers specified for building Elektra are configured such that the user inside the container is a non-root user.
If one wishes to mount the Elektra source directory from the host filesystem as a volume for the container, extra steps are necessary.
Inside the source directory, you can change the permissions to any user id with podman unshare chown $(id -u):$(id -u) -R .
. Keep in mind that this changes the host filesystem. You can read more about this here.
After having changed the permissions, one can run the container
Do not forget the :Z
label. You can read more about the labels in the Podman documentation.
Alternatively, if you prefer to not change the permissions of the host filesystem, you can run the container as a root user. Note however, that the environment will differ from that used in continuous integration and the usual caveats concerning running processes as root apply: