20 lines
456 B
Docker
20 lines
456 B
Docker
|
|
# syntax=docker/dockerfile:1
|
||
|
|
FROM --platform=$BUILDPLATFORM golang:1.25.0 AS builder
|
||
|
|
|
||
|
|
WORKDIR /src
|
||
|
|
COPY go.mod go.sum ./
|
||
|
|
RUN go mod download
|
||
|
|
|
||
|
|
COPY . .
|
||
|
|
|
||
|
|
ARG TARGETOS=linux
|
||
|
|
ARG TARGETARCH=amd64
|
||
|
|
RUN CGO_ENABLED=0 GOOS=$TARGETOS GOARCH=$TARGETARCH \
|
||
|
|
go build -trimpath -ldflags="-s -w" -o /out/soteria ./cmd/soteria
|
||
|
|
|
||
|
|
FROM gcr.io/distroless/static-debian12:nonroot
|
||
|
|
COPY --from=builder /out/soteria /soteria
|
||
|
|
USER 65532:65532
|
||
|
|
EXPOSE 8080
|
||
|
|
ENTRYPOINT ["/soteria"]
|