Browse Source

run: clean service command if entrypoint is overridden (#9836)

Signed-off-by: Guillaume Lours <[email protected]>
Guillaume Lours 3 years ago
parent
commit
279225896a
1 changed files with 3 additions and 0 deletions
  1. 3 0
      pkg/compose/run.go

+ 3 - 0
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)