Skip to content

Commit

Permalink
set osversion in index descriptor from base image
Browse files Browse the repository at this point in the history
Signed-off-by: Tonis Tiigi <[email protected]>
  • Loading branch information
tonistiigi committed Feb 11, 2023
1 parent ad15d56 commit 27f3115
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions frontend/dockerui/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,23 @@ func (bc *Client) Build(ctx context.Context, fn BuildFunc) (*ResultBuilder, erro
if tp != nil {
p = *tp
}

// in certain conditions we allow input platform to be extended from base image
if p.OS == "windows" && img.OS == p.OS {
if p.OSVersion == "" && img.OSVersion != "" {
p.OSVersion = img.OSVersion
}
if p.OSFeatures == nil && len(img.OSFeatures) > 0 {
p.OSFeatures = img.OSFeatures
}
}

if p.Architecture == "arm" && img.Architecture == p.Architecture {
if p.Variant == "" && img.Variant != "" {
p.Variant = img.Variant
}
}

p = platforms.Normalize(p)
k := platforms.Format(p)

Expand Down

0 comments on commit 27f3115

Please sign in to comment.