Container security follows the principle of least privilege. Each container should run with minimal permissions and access only what it needs. Practice Implementation Non-root user RUN adduser -S appuser + USER appuser Read-only filesystem docker run --read-only No new privileges --security-opt=no-new-privileges Scan images docker scout cves billing-catalog:latest Minimal base Alpine-based images reduce attack surface No unnecessary ports Only expose what's needed in Compose Use secrets docker secret or environment variables from vault Never Put in a Dockerfile Passwords, API keys, or tokens Production connection strings Private SSH keys Any value that should differ between environments