diff --git a/commands/build.go b/commands/build.go index 97b863d2..b8348f7b 100644 --- a/commands/build.go +++ b/commands/build.go @@ -726,6 +726,9 @@ func parseInvokeConfig(invoke string) (cfg invokeConfig, err error) { cfg.Cmd = append(cfg.Cmd, value) // TODO: support JSON case "entrypoint": cfg.Entrypoint = append(cfg.Entrypoint, value) // TODO: support JSON + if cfg.Cmd == nil { + cfg.Cmd = []string{} + } case "env": cfg.Env = append(cfg.Env, value) case "user": diff --git a/monitor/monitor.go b/monitor/monitor.go index 0763bfb6..9652d779 100644 --- a/monitor/monitor.go +++ b/monitor/monitor.go @@ -282,6 +282,7 @@ func (m *monitor) startInvoke(ctx context.Context, pid string, cfg controllerapi } if len(cfg.Entrypoint) == 0 && len(cfg.Cmd) == 0 { cfg.Entrypoint = []string{"sh"} // launch shell by default + cfg.Cmd = []string{} } go func() { // Start a new invoke