Files
oauth2-proxy/Dockerfile
2026-02-21 19:33:45 +03:00

25 lines
490 B
Docker

FROM golang:1.26 AS builder
WORKDIR /app
RUN apt-get update && apt-get install -y \
gcc \
libc6-dev \
&& rm -rf /var/lib/apt/lists/*
COPY go.mod go.sum ./
RUN go mod download
COPY . .
RUN go build -ldflags="-linkmode external -extldflags '-static' -s -w" -o oauth2-proxy .
FROM scratch
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
COPY --from=builder /app/oauth2-proxy /oauth2-proxy
EXPOSE 5000
ENTRYPOINT ["/oauth2-proxy"]