Skip to content

Commit

Permalink
arm
Browse files Browse the repository at this point in the history
  • Loading branch information
DrTuup committed May 17, 2024
1 parent d9ee9bb commit 4d953a8
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,20 +1,18 @@
# Create a stage for building the application.
ARG GO_VERSION=1.22.3
FROM --platform=$BUILDPLATFORM golang:${GO_VERSION} AS build
FROM --platform=$BUILDPLATFORM golang:${GO_VERSION}@${TARGETARCH} AS build
WORKDIR /src

RUN --mount=type=cache,target=/go/pkg/mod/ \
--mount=type=bind,source=go.sum,target=go.sum \
--mount=type=bind,source=go.mod,target=go.mod \
go mod download -x

ARG TARGETARCH

RUN --mount=type=cache,target=/go/pkg/mod/ \
--mount=type=bind,target=. \
CGO_ENABLED=0 GOARCH=$TARGETARCH go build -o /bin/server .

FROM alpine:latest AS final
FROM arm32v7/alpine:latest AS final

RUN --mount=type=cache,target=/var/cache/apk \
apk --update add \
Expand Down

0 comments on commit 4d953a8

Please sign in to comment.