From 7b52f3c3b61c9259d054ece152c817aa654fd07b Mon Sep 17 00:00:00 2001 From: Guillaume Lours Date: Mon, 16 Nov 2026 12:27:30 +0100 Subject: [PATCH] fix(dry-run): log skipped hooks at debug level Hooks are skipped silently under --dry-run. Log each skipped hook at debug level so --verbose shows which one would have run. Signed-off-by: Guillaume Lours --- pkg/compose/hook.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkg/compose/hook.go b/pkg/compose/hook.go index 614c69028..8f735d8d9 100644 --- a/pkg/compose/hook.go +++ b/pkg/compose/hook.go @@ -27,6 +27,7 @@ import ( "github.com/moby/moby/api/pkg/stdcopy" "github.com/moby/moby/api/types/container" "github.com/moby/moby/client" + "github.com/sirupsen/logrus" "github.com/docker/compose/v5/internal/naming" "github.com/docker/compose/v5/pkg/api" @@ -44,6 +45,7 @@ func (s *composeService) runHook(ctx context.Context, ctr container.Summary, ser // A dry-run must have no side effects, and the dry-run client cannot // attach to an exec: skip the hook rather than fail on it. if s.dryRun { + logrus.Debugf("dry-run: skipping hook %v of service %s", hook.Command, service.Name) return nil }