You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
all containers, which are exited with status code 0 (we don't need to keep them for debugging / we shouldn't remove containers, which exited with a non zero exit status, because maybe we want to find out, why they exited)
all containers which stopped > n days ago
all dangling images, which are not used by any container any more and which don't have a tag any more
We could start with something like this:
docker ps -a -q --no-trunc --filter exited=0 | xargs --no-run-if-empty docker rm # remove containers with exit code 0
docker images --no-trunc --format "{{.ID}} {{.Repository}} {{.Tag}}"| grep "<none>"| cut -d"" -f 1 | xargs --no-run-if-empty docker rmi # clean images with no tag. Fails for images which are still be used by a container
By doing this, I could free 150 GB on our host brain. I already executed this from time to time.
The text was updated successfully, but these errors were encountered:
by the way docker has a command docker system prune in newer versions. But most probably it will take too long until ubuntu packages a more recent version of docker. So we need to implement this ourself.
Kastenwesen is currently not responsible for containers managed by someone/something else, and I think this is the correct design decision. This job is well done by docker-gc or docker's own commands. By default, if you don't pass other parameters, kastenwesen will keep containers younger than 31 days (for logging purposes) and their images (probably because it is impossible without removing the container).
AFAIK this works as designed, although 31 days is probably not the best default choice if you rebuild 10 GB of images every few days.
ok, then we should use docker-gc. We should also add a note to the readme that kastenwesen cleanup does not clean up the entire system but that one should use docker-gc instead...
IMHO
kastenwesen cleanup
should removeWe could start with something like this:
By doing this, I could free 150 GB on our host brain. I already executed this from time to time.
The text was updated successfully, but these errors were encountered: