fix: 解决容器创建默认 Cmd 失败的问题 (#2641)

pull/2660/head
ssongliu 2023-10-23 15:25:17 +08:00 committed by GitHub
parent 057b5067af
commit 2b9a7df4b2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 0 deletions

View File

@ -342,6 +342,9 @@ func (u *ContainerService) ContainerCreate(req dto.ContainerOperate) error {
if len(req.Entrypoint) == 0 {
req.Entrypoint = imageInfo.Config.Entrypoint
}
if len(req.Cmd) == 0 {
req.Cmd = imageInfo.Config.Cmd
}
config, hostConf, networkConf, err := loadConfigInfo(true, req, nil)
if err != nil {
return err