docker run --read-only --tmpfs /tmp myapp

Category: Docker

docker run --read-only --tmpfs /tmp myapp

Run with a read-only root filesystem

Mounts the container's root filesystem read-only so nothing can write outside declared mounts. The tmpfs /tmp gives processes a scratch area that disappears on exit. Strong hardening for untrusted workloads.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.