From fd1593c067a7063ed24919626cdff4eca954ad90 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Gronowski?= Date: Fri, 31 Oct 2025 12:40:30 +0100 Subject: [PATCH] api/container_inspect: Ensure Config is not nil in inspect response MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Ensure that the JSON response for the `GET /containers/{name}/json` outputs an empty object instead of a nil config. Signed-off-by: Paweł Gronowski --- daemon/server/router/container/inspect.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/daemon/server/router/container/inspect.go b/daemon/server/router/container/inspect.go index 15ee82b5db..73c7f8a12d 100644 --- a/daemon/server/router/container/inspect.go +++ b/daemon/server/router/container/inspect.go @@ -81,5 +81,8 @@ func (c *containerRouter) getContainersByName(ctx context.Context, w http.Respon } } + if ctr.Config == nil { + ctr.Config = &container.Config{} + } return httputils.WriteJSON(w, http.StatusOK, compat.Wrap(ctr, wrapOpts...)) }