After a security hardening pass, api won't start. It was given a read-only root filesystem (--read-only), and now it dies on boot the moment it tries to write its cache. The image and config are unchanged — only the hardening flag was added. Get it running again while keeping the root filesystem read-only.
api — myapp:latest, Exited (1), started with a read-only root FS./app/cache at startup.$ docker logs api
OSError: [Errno 30] Read-only file system: '/app/cache/session.db'
You've solved it when:
Errno 30 / Read-only file system on /app/cache) caused by the
--read-only hardening — not a permissions bug, missing dir, or disk-full.
api up running while keeping the root FS read-only —--tmpfs /app/cache (or a volume mounted
there), so the app can write without un-hardening the whole container.
docker CLI only.api running; the writable path is backed by a tmpfs/volume--read-only entirely is the lazy answer — prefer scoping the
writable path).
--read-only make /app/cache unwritable but `--tmpfs/tmp, pid files, caches) and how do you enumerate them?
--read-only" the wrong fix from a security stance?