From 279225896a0c05c374920392cb93c2ee70a73145 Mon Sep 17 00:00:00 2001 From: Guillaume Lours <705411+glours@users.noreply.github.com> Date: Mon, 26 Sep 2022 18:08:14 +0200 Subject: [PATCH] run: clean service command if entrypoint is overridden (#9836) Signed-off-by: Guillaume Lours <705411+glours@users.noreply.github.com> --- pkg/compose/run.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkg/compose/run.go b/pkg/compose/run.go index 2557e0372..0e6329f70 100644 --- a/pkg/compose/run.go +++ b/pkg/compose/run.go @@ -112,6 +112,9 @@ func applyRunOptions(project *types.Project, service *types.ServiceConfig, opts } if opts.Entrypoint != nil { service.Entrypoint = opts.Entrypoint + if len(opts.Command) == 0 { + service.Command = []string{} + } } if len(opts.Environment) > 0 { cmdEnv := types.NewMappingWithEquals(opts.Environment)