What is `tmpfs` mount used for?
BeginnerConceptVolumes & Bind Mounts
Answer
Ephemeral, memory-backed storage for secrets or scratch space, with optional size and mode.
docker run --tmpfs /run:rw,noexec,nosuid,size=64m myapp
docker run --mount type=tmpfs,dst=/tmp,tmpfs-size=100m myapp
Combined with --read-only, it gives a read-only root with only specific writable paths.
More on Volumes & Bind Mounts
What are the three ways to persist or share data with a container?BeginnerVolume vs bind mount: when do you pick which?BeginnerWhat is the difference between `-v` and `--mount`?BeginnerWhat is an anonymous volume and how do you find leftovers?IntermediateHow does a new named volume get populated?IntermediateHow do you back up and restore a named volume?Intermediate