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.
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.
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.