testcontainers / testcontainers/testcontainers-java
ImageFromDockerfile does not support container reuse
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 8.7k
- Forks
- 1.9k
- Avg merge
- 2d 17h
- Merged PRs (30d)
- 9
Description
After updating to the 1.15.1 version of testcontainers I've noticed an issue, when trying to reuse containers for subsequent runs. I'm creating an image using ImageFromDockerfile, but it defines an image with "default" labels, that includes TESTCONTAINERS_SESSION_ID_LABEL. As far as I've checked, there is no way to not to inherit labels when creating a container using docker, which means, that container also contains this label and is removed by ryuk after test run. The commit that added "default" labels is this one: https://github.com/testcontainers/testcontainers-java/commit/6ac18b2b882f4c1a8b5d550d9ca79de339ce0265
Contributor 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.
Research direction
Start with ImageFromDockerfile and the linked commit that introduced the default labels. Reproduce container reuse with Ryuk enabled, then trace how TESTCONTAINERS_SESSION_ID_LABEL reaches the built image and subsequent container. Done means reused containers are not incorrectly removed by Ryuk; verify with the relevant existing reuse or ImageFromDockerfile tests if available.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker, java
- Domain
- devops, testing
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100