Skip to content

Commit

Permalink
Merge pull request #1130 from Vlatombe/set_image_platform
Browse files Browse the repository at this point in the history
Set image platform for any build
  • Loading branch information
tejal29 authored Mar 25, 2020
2 parents 1b662e7 + 336bcd3 commit 1978f1e
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions pkg/executor/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import (
"fmt"
"os"
"path/filepath"
"runtime"
"strconv"
"strings"
"time"
Expand Down Expand Up @@ -589,6 +590,17 @@ func DoBuild(opts *config.KanikoOptions) (v1.Image, error) {
return nil, err
}

configFile, err := sourceImage.ConfigFile()
if err != nil {
return nil, err
}
configFile.OS = runtime.GOOS
configFile.Architecture = runtime.GOARCH
sourceImage, err = mutate.ConfigFile(sourceImage, configFile)
if err != nil {
return nil, err
}

d, err := sourceImage.Digest()
if err != nil {
return nil, err
Expand Down

0 comments on commit 1978f1e

Please sign in to comment.