DELAPARRA
Index
Color
NL
Category: Docker

tmpfs

Explained by Updated

What is tmpfs?

tmpfs: An in-memory mount that never touches disk and vanishes when the container stops. For secrets and scratch data. A tmpfs mount in Docker is a folder stored in memory instead of on disk. It disappears completely when the container stops. That makes it useful for temporary files that should never touch the disk, such as decrypted secrets, session files or scratch space, and for speed when a program writes many small temporary files.

Definition source Coders Lingo, CC BY 4.0

Frequently asked questions about tmpfs

What should you keep in mind with tmpfs?

Set a size limit, as in --tmpfs /tmp:size=64m, because memory used by tmpfs counts towards the container's memory limit. A runaway process filling it can get the container killed. In Kubernetes, the equivalent is an emptyDir volume with medium: Memory. Combined with a read-only root file system, tmpfs mounts give an application exactly the writable space it needs and nothing more.

What does an example of tmpfs look like?

docker run --tmpfs /run:size=64m myapp:1.0

At a glance

CategoryDocker
Explained by
Updated

More Docker terms

All terms starting with T

Skills

Download all skills (zip)

Manuals

Related services

Need any help?

Stuck on one of these in your own project? Tell me what you are working on and I will tell you how I would approach it.