Testcontainers "no space left on device" in CI
Pulling many test images and starting containers consumes runner disk fast. When the device fills, image extraction or container writes fail with "no space left on device", and the failure can appear mid-pull.
What this error means
Setup fails with "write ...: no space left on device" while extracting an image layer or writing a container volume, often after several images have already been pulled.
Testcontainers
failed to register layer: write /var/lib/docker/...: no space left on deviceCommon causes
Accumulated image layers filled the disk
Multiple large test images plus build artifacts exhaust the runner disk during the job.
Leftover containers and volumes were not reaped
When cleanup (Ryuk or manual) does not run, stopped containers and volumes keep consuming space.
How to fix it
Free disk before or during the job
Prune unused images and reclaim space before starting a heavy Testcontainers suite.
Terminal
docker system prune -af --volumes
df -hReduce the image footprint
- Use smaller base images for the services under test.
- Pull only the images the suite actually needs.
- Keep Ryuk enabled (or clean up manually) so stopped containers are removed.
How to prevent it
- Prune unused images and volumes before large test suites.
- Prefer slim images and pull only what tests require.
- Let Ryuk or an explicit cleanup step reclaim stopped containers.
Related guides
Testcontainers "Previously pulled image ... not available" in CIFix Testcontainers "Previously pulled image, but not available locally" in CI - the image reference resolved…
Testcontainers "pull access denied" / Docker Hub rate limit in CIFix Testcontainers image pull failures in CI - "pull access denied" or "toomanyrequests: You have reached you…
Testcontainers slow first image pull timing out tests in CIFix Testcontainers first-pull slowness in CI - a cold image pull on a fresh runner adds minutes and can push…