[Enhancement]: Allow disabling resource cleanup entirely (no Ryuk, no JVM shutdown hook)
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 55/100
Research direction
Start by locating ResourceReaper.instance() and JVMHookResourceReaper, then trace how TESTCONTAINERS_RYUK_DISABLED and testcontainers.properties values are loaded. Identify the existing tests for resource-reaper selection and add coverage for a no-op mode. The work is done when a supported configuration can disable both Ryuk and the JVM shutdown hook while preserving the existing cleanup modes.
Written by the indexing model from the issue text.
Description
Module
Core
Proposal
Problem
On ephemeral CI runners, Testcontainers' resource cleanup is unnecessary: the whole VM is discarded when the job ends. Setting TESTCONTAINERS_RYUK_DISABLED=true does not turn cleanup off; it switches ResourceReaper.instance() to JVMHookResourceReaper, which on JVM shutdown runs label-filtered docker {network,volume,image} prune calls.
We ran into an issue when upgrading our GitHub Actions runners to Ubuntu 26.04 with Docker 29 and the containerd image store. Our backend build failed in ~36% of runs with image-pull errors like:
failed commit on ref ... no such file or directory
Our hypothesis is moby/moby#53321: an image prune on the containerd store can drop leases of in-progress pulls, even pulls of images that don't match the prune's label filter. So each test JVM exiting can break pulls of other JVMs still running. After re-enabling Ryuk (which removes images individually via ImageRemove, not via prune, the problem disappeared.
Discussion #12085 ("unknown blob" errors with parallel builds) may be related, but its setup differs and there's no confirmed link.
Proposal
Provide a supported way to skip cleanup completely, e.g. an environment variable / testcontainers.properties entry such as TESTCONTAINERS_RESOURCE_REAPER=none (alongside the implicit ryuk / jvm-hook), selecting a no-op ResourceReaper.
Benefit
Ephemeral CI avoids the Ryuk container and its startup cost without falling back to the shutdown-hook prune.
- Dominant language
- Java
- Stars
- 8.8k
- Forks
- 2k
- Avg merge
- 2d 1h
- Merged PRs (30d)
- 11
Getting set up
Starts the project's dev container in your browser, under your own GitHub account.
- Ships a Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from testcontainers/testcontainers-java
-
[Bug]: WaitStrategyTarget Handles Multiple Ports Differently to DocumentationPossibly taken @suvvvv claimed this 2 days ago. Opentype/bug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
testcontainers/testcontainers-java#12196 ·
Maintainers usually reply within 1 day
-
[Bug]: DockerImageName treats uppercase registry names as repository pathsPossibly taken A pull request linked to this issue is open or already merged. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
testcontainers/testcontainers-java#12186 · 1 comment ·
Maintainers usually reply within 1 day
-
[Bug]: withStartupTimeout() changes the startup timeout of all containers that use the default wait strategyPossibly taken @aymenjamaaoui claimed this 18 days ago. Opentype/bug
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
testcontainers/testcontainers-java#12171 · 1 comment ·
Maintainers usually reply within 1 day
-
[Enhancement]: Document why singleton containers are required under Spring's test context cachingPossibly taken @zakaullah075 claimed this 111 days ago. Opentype/enhancement
Difficulty 1/5 Under an hour Newbie friendliness 85/100
testcontainers/testcontainers-java#11967 · 1 comment ·
Maintainers usually reply within 1 day
-
[Bug]: Cannot reuse Selenium BrowserWebDriverContainers under LinuxPossibly taken @kdelay claimed this 132 days ago. Opentype/bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
testcontainers/testcontainers-java#11941 ·
Maintainers usually reply within 1 day
All issues in testcontainers/testcontainers-java
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
Maintainers usually reply within 1 day
-
good first issue help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
erkamyaman/rust-anything#1381 ·
Maintainers usually reply within 1 day
-
enhancement good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 80/100
java-native-access/jna#1757 ·