support service entrypoint set as empty slice (override Dockerfile ENTRYPOINT)

close https://github.com/docker/compose/issues/8581

Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
This commit is contained in:
Nicolas De Loof 2021-09-08 09:38:58 +02:00 committed by Nicolas De loof
parent 2ceb176500
commit 0e0291510c
1 changed files with 2 additions and 2 deletions

View File

@ -251,10 +251,10 @@ func (s *composeService) getCreateOptions(ctx context.Context, p *types.Project,
runCmd strslice.StrSlice
entrypoint strslice.StrSlice
)
if len(service.Command) > 0 {
if service.Command != nil {
runCmd = strslice.StrSlice(service.Command)
}
if len(service.Entrypoint) > 0 {
if service.Entrypoint != nil {
entrypoint = strslice.StrSlice(service.Entrypoint)
}