How do you ship an image that survives `--read-only` and still logs?
IntermediateProductionImage Security & Hardening
Answer
Log to stdout/stderr (never files), mount tmpfs at /tmp and /run, and put caches or pid files in tmpfs. Identify writes with docker diff <container> during tests; every path listed under C/A either needs a volume/tmpfs or an app config change.
docker diff web
More on Image Security & Hardening
Why should containers not run as root, and how do you enforce it?BeginnerWhat is a distroless image and what are the trade-offs?BeginnerHow do you scan an image with Trivy and fail a CI build on serious findings?BeginnerHow do you manage Trivy false positives and accepted risks?IntermediateWhich `docker run` flags make up a hardened runtime baseline?BeginnerWhat does `no-new-privileges` protect against?Beginner