Merge pull request #2693 from tonistiigi/context-default-platform

dockerfile: check named context for default platform if none set
master
Tõnis Tiigi 2022-03-02 08:25:29 -08:00 committed by GitHub
commit 0aa6882334
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -819,6 +819,10 @@ func contextByNameFunc(c client.Client, p *ocispecs.Platform) func(context.Conte
}
name = strings.TrimSuffix(reference.FamiliarString(named), ":latest")
if p == nil {
pp := platforms.Normalize(platforms.DefaultSpec())
p = &pp
}
if p != nil {
name := name + "::" + platforms.Format(platforms.Normalize(*p))
st, img, err := contextByName(ctx, c, name, p)