Container security protects the host, image contents, and runtime process from compromise. Treat it as a design requirement rather than an afterthought when building images. section 3.2.1
Apply two practical safeguards:
- Run the container entry point as a non-privileged user. Docker uses root by default, while Podman uses rootless containers by default; both support alternative modes. section 3.2.1
- Keep passwords and keys out of container images. Removing credentials in a later layer does not erase them from the original layer; use dedicated Docker or Podman secret features instead. section 3.2.1
Least-privilege container execution
A Dockerfile that creates a non-privileged user and assigns it to the entry point reduces the impact of a compromised container. Supplying package credentials through a secret mechanism avoids preserving them in image layers. section 3.2.1



































