File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 6161 cache-from : type=gha
6262 cache-to : type=gha,mode=max
6363 provenance : false
64+
65+ # Guard against mislabeled variants: v0.1.0 through v1.1.8 advertised
66+ # arm64 while shipping an x86-64 binary (TARGETARCH defaults in the
67+ # Dockerfile shadowed the values buildx injects).
68+ - name : Verify per-arch binaries
69+ run : |
70+ set -euo pipefail
71+ image="$(echo "$IMAGE_NAME" | tr '[:upper:]' '[:lower:]')@${{ steps.push.outputs.digest }}"
72+ for arch in amd64 arm64; do
73+ case "$arch" in
74+ amd64) want="x86-64" ;;
75+ arm64) want="aarch64" ;;
76+ esac
77+ docker pull --platform "linux/$arch" "$image" >/dev/null
78+ docker rm -f "verify-$arch" >/dev/null 2>&1 || true
79+ docker create --platform "linux/$arch" --name "verify-$arch" "$image" >/dev/null
80+ docker cp "verify-$arch:/usr/local/bin/liveagent-gateway" "/tmp/gateway-$arch"
81+ docker rm -f "verify-$arch" >/dev/null
82+ info="$(file -b "/tmp/gateway-$arch")"
83+ echo "linux/$arch: $info"
84+ echo "$info" | grep -q "$want" || { echo "::error::linux/$arch image contains a non-$arch gateway binary"; exit 1; }
85+ done
Original file line number Diff line number Diff line change 11# syntax=docker/dockerfile:1.7
22
3- FROM node:22.17.1-bookworm-slim AS webui
3+ FROM --platform=$BUILDPLATFORM node:22.17.1-bookworm-slim AS webui
44
55WORKDIR /src/crates/agent-gateway/web
66RUN npm install -g pnpm@10.32.1
@@ -11,10 +11,11 @@ RUN pnpm install --frozen-lockfile
1111COPY crates/agent-gateway/web ./
1212RUN pnpm build
1313
14- FROM golang:1.25-bookworm AS gateway-builder
14+ FROM --platform=$BUILDPLATFORM golang:1.25-bookworm AS gateway-builder
1515
16- ARG TARGETOS=linux
17- ARG TARGETARCH=amd64
16+ # Keep these ARGs bare: a default value shadows the per-platform values buildx injects.
17+ ARG TARGETOS
18+ ARG TARGETARCH
1819
1920WORKDIR /src/crates/agent-gateway
2021
You can’t perform that action at this time.
0 commit comments