From e192e223b632abfe200ac5a27c6dcb1bd51e5f98 Mon Sep 17 00:00:00 2001 From: Guillaume Lours <705411+glours@users.noreply.github.com> Date: Tue, 13 Sep 2022 11:41:14 +0200 Subject: [PATCH] clean service command if entrypoint is overrided in run command 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 2557e037221..0e6329f7047 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)