From f2e986d12b70f03bce25bcb6f2e817b3d396cd94 Mon Sep 17 00:00:00 2001
From: Jonas Leder <jonas@jonasled.de>
Date: Sun, 13 Apr 2025 14:26:46 +0200
Subject: [PATCH] fix cross compile build with cgo

---
 Dockerfile | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/Dockerfile b/Dockerfile
index 933ddd1..c208c56 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,5 +1,8 @@
 FROM jonasled.dev/firehouse-smokedetection/plugins/gotify:latest@sha256:9710adaa88ff100287212e814538c485c88b65cd115e284df0689c979b4f3ab9  AS plugin-gotify
-FROM golang:1.24.2-alpine AS build
+FROM --platform=$BUILDPLATFORM tonistiigi/xx:1.6.1 AS xx
+FROM --platform=$BUILDPLATFORM golang:1.24.2-alpine AS build
+ARG TARGETPLATFORM
+COPY --from=xx / /
 RUN apk add --no-cache --update binutils binutils-dev binutils-gold g++ gcc
 WORKDIR /app
 COPY go.mod go.sum ./
-- 
GitLab