Root access, do so many apps need it?

I can confirm that running a container as root is usually not a runtime requirement but is often to initially create files (e.g. a PID under /run) and change ownership or mode/permissions of files/folders (especially in a volume mount) before running the primary app as a non-root user (which can only modify certain files). Last year I made a Dockerfile stage to mod recent images for NGINX and PostgreSQL to run correctly as an initial non-root user (well, with minimal errors in logs), to work in a hardened Kubernetes cluster that doesn’t allow running a container as root outside certain blessed namespaces. You have to make sure that the container user and group IDs have appropriate permissions in any mounted volumes - as well as in the files/folders provided in the image. This is all on the user to understand and ensure it all lines up - and if not, either the app refuses to run or you get the occasional odd error you can’t explain. And I’m not talking specifically about TrueNAS here but about container images in general.

So you see why most apps avoid the headache and “require” initially running as root.