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

Cleanup docker containers on termination #445

Merged
merged 2 commits into from
Feb 28, 2024
Merged

Conversation

tbro
Copy link
Contributor

@tbro tbro commented Feb 28, 2024

The --rm switch tells docker to cleanup containers on termination. Without this an explicit remove is required after stop to clean up the container and a prune to remove arbitrary volumes left behind. While these are not difficult actions to perform, we are often unaware that we need to do them.

I've also changed kill to stop because stop in the drop fn because stop attempts to shutdown the container gracefully.

The `--rm` switch tells docker to cleanup containers on
termination. Without this an exlicit `remove` is required after
`stop` to clean up the container and a `prune` to remove arbitarary
volumes left behind. While these are not difficult actions to perform,
we are often unaware that we need to do them.

I've also changed `kill` to `stop` because `stop` in the drop fn
because `stop` attempts to shutdown the container gracefully.
@sveitser
Copy link
Contributor

Since contrainers are now removed on termination why not also remove the explicit docker rm?

https://github.com/EspressoSystems/hotshot-query-service/pull/445/files#diff-cb1e794a808d62e9693c1daa28a4a01d2395ad907f5f72052bef92b8707436fdR1535-R1545

Because docker is now doing this
@tbro tbro merged commit 797c877 into main Feb 28, 2024
10 checks passed
@tbro tbro deleted the docker-cleanup-on-termination branch February 28, 2024 21:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants