Rootless vs Rootful#

epics-containers recommends running containers rootless. This is why we recommend podman, which is rootless by default. (docker is rootful by default but also supports a rootless mode - see Using Docker Instead of Podman.)

Advantages of rootless operation include:

  • Security: rootless containers only have the same permissions as the user running them.

  • Ease of use: in an environment where users do not have root privileges, rootless containers can be run without needing to escalate privileges. This is why DLS uses rootless containers.

  • Host mounts: host mounts have the same permissions as the user running the container.

  • Developer containers: rootless containers can be ‘root’ inside the container, but not on the host.

  • Simplicity: no need to switch users in Dockerfiles - just stay as root and use psuedo-root during runtime. This maps nicely to using the same container in Kubernetes where control of the user id is up to the cluster.

Advantages of rootful operation include:

  • networking: you can create rootable bridge networks that can be accessed from the host

  • power: you can give containers privileged capabilities that the user would not normally have

The advantages of rootless are ideal for developing and executing IOCs, which is why podman (rootless) is the recommended container engine throughout this documentation.