Do not append []string{""} to command to preserve Docker compatibility

Signed-off-by: Andrey Klimentyev <andrey.klimentyev@flant.com>
This commit is contained in:
Andrey Klimentyev 2021-03-29 13:36:24 +03:00
parent eaf286224b
commit 5f3ce9512b

View File

@ -63,9 +63,11 @@ func WithProcessArgs(config *runtime.ContainerConfig, image *imagespec.ImageConf
args = append([]string{}, image.Cmd...)
}
if command == nil {
if !(len(image.Entrypoint) == 1 && image.Entrypoint[0] == "") {
command = append([]string{}, image.Entrypoint...)
}
}
}
if len(command) == 0 && len(args) == 0 {
return errors.New("no command specified")
}