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

Clean up automatically when container stopped #552

Closed
alexcase52 opened this issue Jan 22, 2018 · 10 comments
Closed

Clean up automatically when container stopped #552

alexcase52 opened this issue Jan 22, 2018 · 10 comments

Comments

@alexcase52
Copy link

alexcase52 commented Jan 22, 2018

Hi, is there a way to properly clean up once container stopped?
Would be good to have it as a setter in GenericContainer.

It could rely on this

@bsideup
Copy link
Member

bsideup commented Jan 22, 2018

hi @alexcase52,

Do you want it to be cleaned during the tests or after?

@alexcase52
Copy link
Author

Immediately once the container stopped is better for me - it may retain some space. But usually it is no so important when.

@kiview
Copy link
Member

kiview commented Jan 23, 2018

We already have such a functionality in place (Reaper) and we will soon add a more reliable component for this running outside the JVM.

What functionality are you missing with the current implementation?

@alexcase52
Copy link
Author

OK if you already have it. I just see some strange exited containers appeared after I started experiments with testcontainers. In my case there were postgres containers.

@kiview
Copy link
Member

kiview commented Jan 23, 2018

This will currently happen if you i.e. SIGKILL the JVM process.

@alexcase52
Copy link
Author

Maybe I had this case and some guard here is desirable. Quite often I could terminate tests e.g. while debugging if I see that something failed and I've got what was wrong. Not sure how this docker --rm flag will behave.

@bsideup
Copy link
Member

bsideup commented Jan 23, 2018

@alexcase52
Bad news: --rm doesn't help (try kill -9 your docker run --rm :) )
Good news: we're going to handle that! :) See #545 for the details, to be released soon

@alexcase52
Copy link
Author

Thanks, will wait for this change

@iNikem
Copy link
Contributor

iNikem commented Jan 30, 2018

I believe this can be closed now as #545 is released in 1.6.0

@kiview
Copy link
Member

kiview commented Jan 30, 2018

Closed by #545

@kiview kiview closed this as completed Jan 30, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants