https://dagster.io/ logo
#ask-community
Title
# ask-community
j

Johannes Müller

02/28/2024, 9:13 AM
Hi! I hope it's ok to ask again: https://dagster.slack.com/archives/C01U954MEER/p1708522685593659 What is a good way to handle stale Dagster containers/images in the docker compose setup to prevent us from running out of storage?
z

Zach

02/28/2024, 5:25 PM
Maybe just something simple like a chron job that runs
docker system prune
or something like that?
Does docker compose have an option similar to
--rm
for
docker run --rm <container>
?
j

Johannes Müller

02/29/2024, 6:54 AM
Thanks! I considered both alternatives
Both are possible with docker compose.
I was hoping for a more specialized solution for Dagster since it is creating quite a few containers.
The remove operations are somewhat dangerous since in case an application is down for some reasons it might remove "used" containers by accident.
I'll try to limit this by filtering for containers that have not been used for 14 days, which should be a good enough solution.
(and yes obviously it would be great if any permanent configuration was stored externally instead of in the containers, but that is not the case yet in our setup)