Skip to content

Clean up automatically when container stopped #552

Closed

Description

@alexcase52

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

Activity

  1. bsideup commented on Jan 22, 2018

    @bsideup
    Member

    hi @alexcase52,

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

  2. alexcase52 commented on Jan 22, 2018

    @alexcase52
    Author

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

  3. kiview commented on Jan 23, 2018

    @kiview
    Member

    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?

  4. alexcase52 commented on Jan 23, 2018

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

  5. kiview commented on Jan 23, 2018

    @kiview
    Member

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

  6. alexcase52 commented on Jan 23, 2018

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

  7. bsideup commented on Jan 23, 2018

    @bsideup
    Member

    @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

  8. alexcase52 commented on Jan 23, 2018

    @alexcase52
    Author

    Thanks, will wait for this change

  9. iNikem commented on Jan 30, 2018

    @iNikem
    Contributor

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

  10. kiview commented on Jan 30, 2018

    @kiview
    Member

    Closed by #545

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions