17.7. Running Podman with extended privileges
If you cannot run your workloads in a rootless environment, you need to run these workloads as a root user. Running a container with extended privileges should be done judiciously, because it disables all security features.
Prerequisites
-
The
container-toolsmeta-package is installed.
Procedure
Run the Podman container in the Podman container:
$ podman run --privileged --name=privileged_podman \ registry.access.redhat.com//podman podman run ubi10 echo hello Resolved "ubi10" as an alias (/etc/containers/registries.conf.d/001-rhel-shortnames.conf) Trying to pull registry.access.redhat.com/ubi10:latest... ... Storing signatures hello-
Run the outer container named
privileged_podmanbased on theregistry.access.redhat.com/ubi10/podmanimage. -
The
--privilegedoption disables the security features that isolate the container from the host. -
Run
podman run ubi10 echo hellocommand to create the inner container based on theubi10image. -
Notice that the
ubi10short image name was resolved as an alias. As a result, theregistry.access.redhat.com/ubi10:latestimage is pulled.
Verification
List all containers:
$ podman ps -a CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 52537876caf4 registry.access.redhat.com/ubi10/podman podman run ubi10 e... 30 seconds ago Exited (0) 13 seconds ago privileged_podmanFor more information, see the
podman-run(1)man page on your system.