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.
More on Volumes, storage and data
A Postgres container was removed and the data is gone. How should it have been run?BeginnerBind mount or named volume for local development of a Node app?BeginnerHow do you back up a named volume?IntermediateTwo containers must share files. What are your options?BeginnerA container needs a writable temp area but the root filesystem is read-only.IntermediateMoving a database volume from one Docker host to another.Intermediate