Skip to content

Commit

Permalink
default os/arch for image export via docker load
Browse files Browse the repository at this point in the history
More defaulting is required to fix same issues as #354 where os/arch is
required by buildkit
  • Loading branch information
coryb committed May 22, 2024
1 parent ac2fa9b commit 543ef50
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions codegen/builtin_fs.go
Original file line number Diff line number Diff line change
Expand Up @@ -968,6 +968,22 @@ func (dl DockerLoad) Call(ctx context.Context, cln *client.Client, val Value, op
return nil, err
}

defaultPlat := DefaultPlatform(ctx)
switch {
case exportFS.Image.OS != "": // all good
case exportFS.Platform.OS != "":
exportFS.Image.OS = exportFS.Platform.OS
default:
exportFS.Image.OS = defaultPlat.OS
}
switch {
case exportFS.Image.Architecture != "": // all good
case exportFS.Platform.Architecture != "":
exportFS.Image.Architecture = exportFS.Platform.Architecture
default:
exportFS.Image.Architecture = defaultPlat.Architecture
}

for _, opt := range opts {
switch o := opt.(type) {
case solver.SolveOption:
Expand Down

0 comments on commit 543ef50

Please sign in to comment.