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

Container's volumes not deleted with the containers itself #168

Closed
dortibi opened this issue Nov 24, 2019 · 1 comment
Closed

Container's volumes not deleted with the containers itself #168

dortibi opened this issue Nov 24, 2019 · 1 comment
Labels
enhancement New feature or request
Milestone

Comments

@dortibi
Copy link

dortibi commented Nov 24, 2019

I used Postgres container and I also created a new type (Vault container).
each of the containers mounted a volume to the disk, after the tested finished and the container deleted, the volume was still in the disk and I needed to use docker system prune for deleted them.

To Reproduce
Steps to reproduce the behavior:

  1. Run Postgres test container
  2. Finish the UT gracefully saw the dispose will call
  3. go to the terminal and run docker volume ls -f dangling=true
    and see the unused volumes

I tried to override the dispose method in the container class I created but the details of the containers and the used volumes are private and I couldn't access it for calling the remove after the docker removed.
also I could use your docker api client since its internal so anyway I need to do the system call separately.

there is other way to do it, by calling the container remove with the flag -v that delete the unnamed volumes with it (only unnamed volumes, I'm not sure what kind of volumes you using)

Desktop (please complete the following information):

  • Server: Docker Engine - Community
    Engine:
    Version: 19.03.5
  • Nuget version - 0.0.9
@HofmeisterAn
Copy link
Collaborator

@HofmeisterAn HofmeisterAn added the enhancement New feature or request label Nov 25, 2019
@HofmeisterAn HofmeisterAn added this to the 1.0.0 milestone Nov 25, 2019
HofmeisterAn added a commit that referenced this issue Nov 28, 2019
…ntainersClient'

{Remove Docker associated links and volumes on clean up.}
HofmeisterAn added a commit that referenced this issue Nov 28, 2019
…ntainersClient'

{Remove Docker associated volumes on clean up.}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants