@@ -6,11 +6,11 @@ import (
6
6
"fmt"
7
7
"maps"
8
8
"os"
9
- "runtime"
10
9
"slices"
11
10
"strings"
12
11
"time"
13
12
13
+ "github.com/containerd/platforms"
14
14
"github.com/containers/buildah/define"
15
15
"github.com/containers/buildah/docker"
16
16
internalUtil "github.com/containers/buildah/internal/util"
@@ -137,18 +137,19 @@ func (b *Builder) fixupConfig(sys *types.SystemContext) {
137
137
if b .OCIv1 .Created == nil || b .OCIv1 .Created .IsZero () {
138
138
b .OCIv1 .Created = & now
139
139
}
140
+ currentPlatformSpecification := platforms .DefaultSpec ()
140
141
if b .OS () == "" {
141
142
if sys != nil && sys .OSChoice != "" {
142
143
b .SetOS (sys .OSChoice )
143
144
} else {
144
- b .SetOS (runtime . GOOS )
145
+ b .SetOS (currentPlatformSpecification . OS )
145
146
}
146
147
}
147
148
if b .Architecture () == "" {
148
149
if sys != nil && sys .ArchitectureChoice != "" {
149
150
b .SetArchitecture (sys .ArchitectureChoice )
150
151
} else {
151
- b .SetArchitecture (runtime . GOARCH )
152
+ b .SetArchitecture (currentPlatformSpecification . Architecture )
152
153
}
153
154
// in case the arch string we started with was shorthand for a known arch+variant pair, normalize it
154
155
ps := internalUtil .NormalizePlatform (ociv1.Platform {OS : b .OS (), Architecture : b .Architecture (), Variant : b .Variant ()})
@@ -158,6 +159,8 @@ func (b *Builder) fixupConfig(sys *types.SystemContext) {
158
159
if b .Variant () == "" {
159
160
if sys != nil && sys .VariantChoice != "" {
160
161
b .SetVariant (sys .VariantChoice )
162
+ } else {
163
+ b .SetVariant (currentPlatformSpecification .Variant )
161
164
}
162
165
// in case the arch string we started with was shorthand for a known arch+variant pair, normalize it
163
166
ps := internalUtil .NormalizePlatform (ociv1.Platform {OS : b .OS (), Architecture : b .Architecture (), Variant : b .Variant ()})
0 commit comments