Docker Security

docker run --read-only

Mount the container root read-only; separate writable mounts retain their own permissions. Plan application write paths and test them. Positive scratch write does not prove root filesystem denial; test separately.

Formal Syntax & Structure

docker syntaxdocker
docker run --read-only IMAGE [COMMAND]

Working Example

Example Snippetdocker
docker run --rm --pull=never --network none --read-only busybox:1.36 echo ok
Docker Reference