Merge pull request #2672 from tonistiigi/copy-link-state

dockerfile: fix COPY —link to keep previous llb state
master
Tõnis Tiigi 2022-02-23 11:22:13 -08:00 committed by GitHub
commit b124b0c3f1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -1076,7 +1076,7 @@ func dispatchCopyFileOp(d *dispatchState, cfg copyConfig) error {
fileOpt = append(fileOpt, llb.ProgressGroup(identity.NewID(), prefixCommand(d, name, d.prefixPlatform, &platform, env)))
d.cmdIndex--
mergeOpt := append(fileOpt, llb.WithCustomName(prefixCommand(d, "LINK "+name, d.prefixPlatform, &platform, env)))
d.state = llb.Merge([]llb.State{d.state, llb.Scratch().File(a, fileOpt...)}, mergeOpt...)
d.state = d.state.WithOutput(llb.Merge([]llb.State{d.state, llb.Scratch().File(a, fileOpt...)}, mergeOpt...).Output())
} else {
d.state = d.state.File(a, fileOpt...)
}