File tree Expand file tree Collapse file tree 2 files changed +9
-5
lines changed Expand file tree Collapse file tree 2 files changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -364,9 +364,11 @@ tasks:
364364 SHA :
365365 sh : git rev-parse HEAD || echo "unknown"
366366 REPO : ' {{.REPO | default "ghcr.io/stacklok/toolhive"}}'
367+ PLATFORM :
368+ sh : echo "${PLATFORM:-linux/$(go env GOARCH)}"
367369 cmds :
368370 - >
369- eval "{{.CONTAINER_RUNTIME}} build --load
371+ eval "{{.CONTAINER_RUNTIME}} build --platform={{.PLATFORM}} -- load
370372 -t {{.REPO}}/thv-operator:{{.SHA}}-ubi
371373 --build-arg CODEDIR=cmd/thv-operator
372374 --build-arg VERSION={{.SHA}}-ubi
@@ -386,9 +388,11 @@ tasks:
386388 SHA :
387389 sh : git rev-parse HEAD || echo "unknown"
388390 REPO : ' {{.REPO | default "ghcr.io/stacklok/toolhive"}}'
391+ PLATFORM :
392+ sh : echo "${PLATFORM:-linux/$(go env GOARCH)}"
389393 cmds :
390394 - >
391- eval "{{.CONTAINER_RUNTIME}} build --load
395+ eval "{{.CONTAINER_RUNTIME}} build --platform={{.PLATFORM}} -- load
392396 -t {{.REPO}}/thv-proxyrunner:{{.SHA}}-ubi
393397 --build-arg CODEDIR=cmd/thv-proxyrunner
394398 --build-arg VERSION={{.SHA}}-ubi
Original file line number Diff line number Diff line change @@ -26,10 +26,10 @@ RUN CGO_ENABLED=0 LDFLAGS="-s -w \
2626-X github.com/stacklok/toolhive/pkg/versions.Commit=${COMMIT} \
2727-X github.com/stacklok/toolhive/pkg/versions.BuildDate=${BUILD_DATE} \
2828-X github.com/stacklok/toolhive/pkg/versions.BuildType=release" \
29- GOOS=linux GOARCH=amd64 go build -ldflags "${LDFLAGS}" -o main ./${CODEDIR}/main.go
29+ go build -ldflags "${LDFLAGS}" -o main ./${CODEDIR}/main.go
3030
31- # Use micro base image to package the binary
32- FROM --platform=linux/amd64 registry.access.redhat.com/ubi10/ubi-minimal:10.1-1763362715
31+ # Use minimal base image to package the binary
32+ FROM registry.access.redhat.com/ubi10/ubi-minimal:10.1-1763362715
3333
3434COPY --from=builder /workspace/main /
3535COPY LICENSE /licenses/LICENSE
You can’t perform that action at this time.
0 commit comments