Passer au contenu principal

Lister les images inutilisées

RUNNINGS_IMAGES=$(docker ps --format {{.Image}})
docker images --format "table {{.ID}}\t{{.Size}}\t{{.Repository}}:{{.Tag}}" \
| grep -v "$RUNNINGS_IMAGES"
unset RUNNINGS_IMAGES

Exemple de rendu :

root@localhost:/# RUNNINGS_IMAGES=$(docker ps --format {{.Image}}); docker images --format "table {{.ID}}\t{{.Size}}\t{{.Repository}}:{{.Tag}}" | grep -v "$RUNNINGS_IMAGES" ; unset RUNNINGS_IMAGES
IMAGE ID       SIZE      REPOSITORY:TAG
cb09058f6eed   418MB     synapse:mainline
a8bb53036fd3   93.2MB    otel/opentelemetry-collector:latest
b9559acf35ef   60.3MB    jaegertracing/all-in-one:latest
b50ee6079167   223MB     registry.gitlab.com/mb-saces/synatainer:latest
2f20774a9bec   724MB     ttrss:latest
e148e14f6f5b   243MB     halfshot/matrix-appservice-discord:latest