feat: disable cache-copy-layers in multistage builds; closes 2065 (#2227)

This commit is contained in:
dmr
2022-08-25 21:36:56 -04:00
committed by GitHub
parent 06866c0b4c
commit 239d16cd1c
2 changed files with 37 additions and 0 deletions
+4
View File
@@ -58,6 +58,10 @@ func ParseStages(opts *config.KanikoOptions) ([]instructions.Stage, []instructio
return nil, nil, errors.Wrap(err, "parsing dockerfile")
}
if opts.CacheCopyLayers && len(stages) >= 2 {
return nil, nil, errors.New("kaniko does not support caching copy layers in multistage builds")
}
metaArgs, err = expandNested(metaArgs, opts.BuildArgs)
if err != nil {
return nil, nil, errors.Wrap(err, "expanding meta ARGs")