add support for arm64 docker builds using Buildx+QEMU (#152)

Co-authored-by: flexxxxer <bahx4pc@gmail.com>
This commit is contained in:
Aleksandr 2024-08-22 00:55:14 +00:00 committed by GitHub
parent 455b9c1ec6
commit 9babb62afc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 14 additions and 6 deletions

View file

@ -1,4 +1,4 @@
FROM golang:1.22.1-alpine3.19 as build
FROM golang:1.22.1-alpine3.19 AS build
WORKDIR /app
@ -9,7 +9,10 @@ RUN go mod download
COPY . .
ENV CGO_ENABLED=0
# Architecture and OS are set dynamically (by BuildKit)
ARG TARGETOS
ARG TARGETARCH
ENV CGO_ENABLED=0 GOOS=$TARGETOS GOARCH=$TARGETARCH
RUN go build -o anonymousoverflow && go build -o healthcheck ./src/healthcheck