build: publish metis images per architecture

This commit is contained in:
Brad Stein 2026-03-31 15:44:37 -03:00
parent 52a87db220
commit db2c7ae023
2 changed files with 29 additions and 18 deletions

View File

@ -1,9 +1,14 @@
# syntax=docker/dockerfile:1.7 # syntax=docker/dockerfile:1.7
FROM golang:1.22-bookworm AS build ARG BUILDPLATFORM=linux/amd64
ARG TARGETPLATFORM
ARG TARGETOS
ARG TARGETARCH
ARG TARGETOS=linux FROM --platform=$BUILDPLATFORM golang:1.22-bookworm AS build
ARG TARGETARCH=arm64
ARG TARGETOS
ARG TARGETARCH
WORKDIR /src WORKDIR /src
COPY go.mod go.sum ./ COPY go.mod go.sum ./

20
Jenkinsfile vendored
View File

@ -194,26 +194,32 @@ PY
} }
} }
stage('Build & push image') { stage('Build & push images') {
steps { steps {
container('builder') { container('builder') {
sh ''' sh '''
set -euo pipefail set -euo pipefail
VERSION_TAG="$(cut -d= -f2 build.env)" VERSION_TAG="$(cut -d= -f2 build.env)"
for arch in amd64 arm64; do
docker buildx build \ docker buildx build \
--platform linux/amd64,linux/arm64 \ --platform "linux/${arch}" \
--tag "${IMAGE}:${VERSION_TAG}" \ --build-arg TARGETOS=linux \
--tag "${IMAGE}:latest" \ --build-arg TARGETARCH="${arch}" \
--tag "${IMAGE}:${VERSION_TAG}-${arch}" \
--tag "${IMAGE}:latest-${arch}" \
--target runtime \ --target runtime \
--push \ --push \
. .
docker buildx build \ docker buildx build \
--platform linux/amd64,linux/arm64 \ --platform "linux/${arch}" \
--tag "${SENTINEL_IMAGE}:${VERSION_TAG}" \ --build-arg TARGETOS=linux \
--tag "${SENTINEL_IMAGE}:latest" \ --build-arg TARGETARCH="${arch}" \
--tag "${SENTINEL_IMAGE}:${VERSION_TAG}-${arch}" \
--tag "${SENTINEL_IMAGE}:latest-${arch}" \
--target sentinel \ --target sentinel \
--push \ --push \
. .
done
''' '''
} }
} }