-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
7 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,13 @@ | ||
FROM golang:1.23-alpine as builder | ||
FROM golang:1.23-alpine AS builder | ||
|
||
# Setup | ||
RUN mkdir -p /go/src/github.com/mesosphere/traefik-forward-auth | ||
WORKDIR /go/src/github.com/mesosphere/traefik-forward-auth | ||
|
||
# Add libraries | ||
RUN apk add --no-cache git | ||
|
||
# Copy & build | ||
ADD . /go/src/github.com/mesosphere/traefik-forward-auth/ | ||
RUN CGO_ENABLED=0 GOOS=linux GO111MODULE=on go build -a -installsuffix nocgo -o /traefik-forward-auth github.com/mesosphere/traefik-forward-auth/cmd | ||
COPY . /src | ||
RUN \ | ||
cd /src && \ | ||
CGO_ENABLED=0 go build -ldflags="-s -w" -trimpath -o /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"] | ||
COPY --from=builder /traefik-forward-auth / | ||
ENTRYPOINT ["/traefik-forward-auth"] |