瀏覽代碼

ignore image we can't build when forcing PullPolicyBuild

close https://github.com/docker/compose-cli/issues/1776

Signed-off-by: Nicolas De Loof <[email protected]>
Nicolas De Loof 4 年之前
父節點
當前提交
679d24a178
共有 1 個文件被更改,包括 3 次插入0 次删除
  1. 3 0
      cli/cmd/compose/create.go

+ 3 - 0
cli/cmd/compose/create.go

@@ -104,6 +104,9 @@ func (opts createOptions) GetTimeout() *time.Duration {
 func (opts createOptions) Apply(project *types.Project) {
 	if opts.Build {
 		for i, service := range project.Services {
+			if service.Build == nil {
+				continue
+			}
 			service.PullPolicy = types.PullPolicyBuild
 			project.Services[i] = service
 		}