Docker Concepts
tmpfs mounts
Provide temporary Linux filesystem space that disappears when a container stops. Set a small size limit; this is a ceiling, not reserved RAM. Data may reach swap. Do not use for persistent records. A saved mount request does not establish a live mount or prove the absence of swap use.
Formal Syntax & Structure
docker syntaxdocker
--mount type=tmpfs,dst=PATH,tmpfs-size=BYTESParameters & Attributes
| Name | Type | Description |
|---|---|---|
| PATH | string | Container destination. |
| BYTES | string | Size ceiling in bytes. |
Working Example
Example Snippetdocker
docker run --rm --pull=never --network none --mount type=tmpfs,dst=/scratch,tmpfs-size=1048576 busybox:1.37 sh -c 'printf note > /scratch/note; cat /scratch/note'