Interview Prep/Docker/Volumes, storage and data

A container writes huge files to `/tmp` and gets OOM-killed.

IntermediateScenarioVolumes, storage and data
Answer

Situation read → /tmp is probably tmpfs (counts as memory) or a mounted tmpfs.

What I'd do → Move large temp files to a disk volume (-v scratch:/scratch) and set TMPDIR=/scratch, or cap tmpfs with size=. Confirm with docker inspect -f '{{.HostConfig.Tmpfs}}' c and df -h /tmp inside.

Why → tmpfs pages are charged to the container's memory cgroup.

Interview tip → Plain overlay /tmp is on disk; tmpfs only if explicitly mounted.

All Docker questions Roadmap: Docker & containers

More on Volumes, storage and data