system/kamaji: multiarch support

Signed-off-by: nbykov0 <166552198+nbykov0@users.noreply.github.com>
This commit is contained in:
nbykov0
2025-05-10 17:48:53 +03:00
parent f6e3188ab8
commit 77e6db3381
2 changed files with 6 additions and 3 deletions

View File

@@ -14,6 +14,8 @@ update:
image:
docker buildx build images/kamaji \
--provenance false \
--builder=$(BUILDER) \
--platform=$(PLATFORM) \
--tag $(REGISTRY)/kamaji:$(call settag,$(TAG)) \
--cache-from type=registry,ref=$(REGISTRY)/kamaji:latest \
--cache-to type=inline \

View File

@@ -1,8 +1,9 @@
# Build the manager binary
FROM golang:1.23 as builder
FROM golang:1.23 AS builder
ARG VERSION=edge-25.3.2
ARG TARGETOS TARGETARCH
ARG TARGETOS
ARG TARGETARCH
WORKDIR /workspace
@@ -11,7 +12,7 @@ RUN curl -sSL https://github.com/clastix/kamaji/archive/refs/tags/${VERSION}.tar
COPY patches /patches
RUN git apply /patches/*.diff
RUN CGO_ENABLED=0 GOOS=linux GOARCH=$TARGETARCH go build \
RUN GOOS=$TARGETOS GOARCH=$TARGETARCH CGO_ENABLED=0 go build \
-ldflags "-X github.com/clastix/kamaji/internal.GitRepo=$GIT_REPO -X github.com/clastix/kamaji/internal.GitTag=$GIT_LAST_TAG -X github.com/clastix/kamaji/internal.GitCommit=$GIT_HEAD_COMMIT -X github.com/clastix/kamaji/internal.GitDirty=$GIT_MODIFIED -X github.com/clastix/kamaji/internal.BuildTime=$BUILD_DATE" \
-a -o kamaji main.go