forked from thomseddon/traefik-forward-auth
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
20 lines (16 loc) · 766 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
FROM --platform=$BUILDPLATFORM golang:1.22-alpine as builder
# Setup
WORKDIR /go/src/github.com/thomseddon/traefik-forward-auth
# Install deps
COPY go.mod /go/src/github.com/thomseddon/traefik-forward-auth/
COPY go.sum /go/src/github.com/thomseddon/traefik-forward-auth/
RUN go mod download
# Copy & build
ADD . /go/src/github.com/thomseddon/traefik-forward-auth/
ARG TARGETOS TARGETARCH
RUN CGO_ENABLED=0 GOOS=${TARGETOS} GOARCH=${TARGETARCH} GO111MODULE=on go build -a -installsuffix nocgo -o /traefik-forward-auth github.com/thomseddon/traefik-forward-auth/cmd
# Copy into scratch container
FROM scratch
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
COPY --from=builder /traefik-forward-auth ./
ENTRYPOINT ["./traefik-forward-auth"]