system/kubeovn-webhook: multiarch support

Signed-off-by: nbykov0 <166552198+nbykov0@users.noreply.github.com>
This commit is contained in:
nbykov0
2025-05-12 03:06:57 +03:00
parent 4a2c67e045
commit 31ea5eeeb2
2 changed files with 8 additions and 3 deletions

View File

@@ -7,6 +7,8 @@ include ../../../scripts/package.mk
image:
docker buildx build images/kubeovn-webhook \
--provenance false \
--builder=$(BUILDER) \
--platform=$(PLATFORM) \
--tag $(REGISTRY)/kubeovn-webhook:$(call settag,$(TAG)) \
--cache-from type=registry,ref=$(REGISTRY)/kubeovn-webhook:latest \
--cache-to type=inline \

View File

@@ -1,11 +1,14 @@
FROM golang:1.23 as builder
FROM golang:1.23 AS builder
ARG TARGETOS
ARG TARGETARCH
WORKDIR /app
COPY go.mod go.sum ./
RUN go mod download
RUN GOOS=$TARGETOS GOARCH=$TARGETARCH go mod download
COPY . .
RUN CGO_ENABLED=0 GOOS=linux go build -o webhook .
RUN GOOS=$TARGETOS GOARCH=$TARGETARCH CGO_ENABLED=0 go build -o webhook .
FROM alpine:3.21.3
WORKDIR /app