Files
wonderwall/Dockerfile
Trong Huu Nguyen b08c1cca75 ci: allow downloading newer toolchain
The default images for Go sets GOTOOLCHAIN=local
which forces builds to use the bundled Go version.

Setting this to auto allows for upgrading to a newer version
if specified by the toolchain directive in go.mod.

Useful for situations where the latest Go Docker image lags
behind the latest Go version.
2024-07-02 22:36:18 +02:00

18 lines
389 B
Docker

FROM --platform=$BUILDPLATFORM golang:1.22 as builder
ENV CGO_ENABLED=0
ENV GOTOOLCHAIN=auto
WORKDIR /src
COPY go.mod go.sum ./
RUN go mod download
COPY . .
ARG TARGETOS
ARG TARGETARCH
RUN GOOS=$TARGETOS GOARCH=$TARGETARCH make wonderwall
FROM gcr.io/distroless/static-debian12:nonroot
WORKDIR /app
COPY --from=builder /src/bin/wonderwall /app/wonderwall
ENTRYPOINT ["/app/wonderwall"]