From 704a9fd337d33702c7c59a8aaff4ad66774f9cc3 Mon Sep 17 00:00:00 2001 From: Matthew Walowski Date: Fri, 27 Oct 2023 10:46:00 -0500 Subject: [PATCH] Use project.ServiceNames() if no service specified in hash Signed-off-by: Matthew Walowski --- cmd/compose/config.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cmd/compose/config.go b/cmd/compose/config.go index 0e50ee683..b4a9baedf 100644 --- a/cmd/compose/config.go +++ b/cmd/compose/config.go @@ -190,6 +190,10 @@ func runHash(ctx context.Context, dockerCli command.Cli, opts configOptions) err return err } + if len(services) == 0 { + services = project.ServiceNames() + } + sorted := services sort.Slice(sorted, func(i, j int) bool { return sorted[i] < sorted[j]