From c15789eb7397bef5325daf0eaa865f3dde53622f Mon Sep 17 00:00:00 2001 From: Prabhat Khera <91852476+prabhat-portainer@users.noreply.github.com> Date: Thu, 18 Apr 2024 17:14:39 +1200 Subject: [PATCH] fix(images): consider stopped containers for unused label [EE-6983] (#11629) --- api/http/handler/docker/images/images_list.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/api/http/handler/docker/images/images_list.go b/api/http/handler/docker/images/images_list.go index 1af28a864..623bd39e1 100644 --- a/api/http/handler/docker/images/images_list.go +++ b/api/http/handler/docker/images/images_list.go @@ -64,7 +64,9 @@ func (handler *Handler) imagesList(w http.ResponseWriter, r *http.Request) *http imageUsageSet := set.Set[string]{} if withUsage { - containers, err := cli.ContainerList(r.Context(), container.ListOptions{}) + containers, err := cli.ContainerList(r.Context(), container.ListOptions{ + All: true, + }) if err != nil { return httperror.InternalServerError("Unable to retrieve Docker containers", err) }