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
FROM golang:1.22-bookworm AS build
ARG BUILDPLATFORM=linux/amd64
ARG TARGETPLATFORM
ARG TARGETOS
ARG TARGETARCH
ARG TARGETOS=linux
ARG TARGETARCH=arm64
FROM --platform=$BUILDPLATFORM golang:1.22-bookworm AS build
ARG TARGETOS
ARG TARGETARCH
WORKDIR /src
COPY go.mod go.sum ./

36
Jenkinsfile vendored
View File

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