DEV Community

Discussion on: When Containers Become Trashcans

Collapse
 
andrewdmay profile image
Andrew May

Ah I know that feeling very well - particularly from utility containers that run a task and then finish, but the container hangs around!

I've got in the habit of using the --rm flag on docker run almost all the time so that the container is removed when stopped - I still need to prune occasionally, but not as often.

Collapse
 
rionmonster profile image
Rion Williams

Hi Andrew!

I'm in the same boat as well, it makes things so much easier when you clean up after you make the mess instead of waiting until things get really hairy.

This was just an older machine from back when I first discovered docker and obviously, didn't know or care how to clean up after myself!