Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Containers created by Docker Compose are not cleaned by Ryuk #372

Closed
kiview opened this issue Oct 27, 2021 · 2 comments · Fixed by #2485
Closed

Containers created by Docker Compose are not cleaned by Ryuk #372

kiview opened this issue Oct 27, 2021 · 2 comments · Fixed by #2485
Labels
compose Docker Compose. good first issue Want to contribute to testcontainers? Start from here hacktoberfest Pull Requests accepted for Hacktoberfest.

Comments

@kiview
Copy link
Member

kiview commented Oct 27, 2021

Containers created and started by testcontainers-go through Docker Compose are not guaranteed to be cleaned up (and this is something I personally observed when running the testcontainers-go test suite on WSL), since Ryuk is not aware of them.

We solved this issue in testcontainers-java by registering the project label added by Docker Compose with Ryuk:
https://github.com/testcontainers/testcontainers-java/blob/76f11b344ce42ad920828b0628a7ec929a9d0eca/core/src/main/java/org/testcontainers/containers/DockerComposeContainer.java#L312

@mdelapenya mdelapenya added type/bug good first issue Want to contribute to testcontainers? Start from here labels May 19, 2022
@mdelapenya mdelapenya added hacktoberfest Pull Requests accepted for Hacktoberfest. compose Docker Compose. labels Sep 29, 2022
@settings settings bot removed the type/bug label Oct 26, 2022
@mdelapenya
Copy link
Collaborator

See my comments on a possible update here: #465 (comment)

@lwaddicor
Copy link

Hey, I came across this problem recently. For the time being I fixed it within our code by having our helper code create an intermediate docker compose file with the reaper labels added for all the services.

Not the most elegent solution, but works nicely and is mostly transparent to the user. Thought i'd post it here in case it is useful in the future

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compose Docker Compose. good first issue Want to contribute to testcontainers? Start from here hacktoberfest Pull Requests accepted for Hacktoberfest.
Projects
None yet
3 participants