I’ve read that standard containers are optimized for developer productivity and not security, which makes sense.

But then what would be ideal to use for security? Suppose I want to isolate environments from each other for security purposes, to run questionable programs or reduce attack surface. What are some secure solutions?

Something without the performance hit of VMs

  • Differences you find could be related to containers being run rootless, or the host system having SELinux enforcesd. Both problems could be intended behavior and can be soled simply by using by adding correct labels to mount points like :z or :Z. This SELinux feature also affects Docker when setup.

    Portaiers tries to connect to a docker sock path that is not the same with Podman. While podman is rootless and does not need a daemon, socks and stuff, it has support for them nevertheless. So you can simply adjust Portainer config to work with podman. I havnt tried it yet but I managed to do similar things for other software.

    • I dont have much idea about SELinux, apart from the name. But I think the problem I was having was specifically wrt uid, with docker I used to add user with the same uid/gid as the host user, as a developer this would help me with debugging. But this differs with the non root setup.