Create Read-Only Filesystems In Containers

Create Container With Read-Only File System

Create and run (docker run) a detached container (--detach) whose file system is read-only (--read-only) with the exception of the /files/ directory (-v /files/) and a temp folder at /tmp (-tmpfs /tmp) using the Docker image nginx:latest.

docker run --detach --read-only -v /files/ --tmpfs /tmp nginx:latest
7cc0ce7b4eb7c7b25b49e80c1c9e633fd0cba2a87a30cbc5bae42d8d17ad37bc