9ab31a9827
Build and Test / verify (push) Successful in 32s
Build and Push Container Image / build-and-push-image (push) Successful in 50s
26 lines
589 B
Docker
26 lines
589 B
Docker
ARG GO_VERSION=1.26
|
|
ARG GOPROXY_URL=https://gitea.nehmer.net/api/packages/torben/go,https://proxy.golang.org,direct
|
|
|
|
FROM golang:${GO_VERSION}-bookworm AS build
|
|
WORKDIR /src
|
|
ARG GOPROXY_URL
|
|
ENV GOPROXY=${GOPROXY_URL}
|
|
|
|
COPY go.mod ./
|
|
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/authproxy ./cmd/authproxy
|
|
|
|
FROM gcr.io/distroless/static-debian12:nonroot
|
|
COPY --from=build /out/authproxy /authproxy
|
|
|
|
EXPOSE 8080
|
|
USER nonroot:nonroot
|
|
|
|
ENTRYPOINT ["/authproxy"]
|