2020-01-18 14:26:54 +00:00
|
|
|
FROM golang:1.13-alpine as builder
|
2018-06-26 12:28:47 +01:00
|
|
|
|
|
|
|
# Setup
|
2019-01-30 16:52:47 +00:00
|
|
|
RUN mkdir -p /go/src/github.com/thomseddon/traefik-forward-auth
|
|
|
|
WORKDIR /go/src/github.com/thomseddon/traefik-forward-auth
|
2018-06-26 12:28:47 +01:00
|
|
|
|
|
|
|
# Add libraries
|
2019-04-18 15:07:39 +01:00
|
|
|
RUN apk add --no-cache git
|
2018-06-26 12:28:47 +01:00
|
|
|
|
|
|
|
# Copy & build
|
2019-01-30 16:52:47 +00:00
|
|
|
ADD . /go/src/github.com/thomseddon/traefik-forward-auth/
|
2019-09-30 10:53:01 +01:00
|
|
|
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 GO111MODULE=on go build -a -installsuffix nocgo -o /traefik-forward-auth github.com/thomseddon/traefik-forward-auth/cmd
|
2018-06-26 12:28:47 +01:00
|
|
|
|
|
|
|
# Copy into scratch container
|
|
|
|
FROM scratch
|
2018-06-26 14:46:11 +01:00
|
|
|
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
|
2018-06-26 12:28:47 +01:00
|
|
|
COPY --from=builder /traefik-forward-auth ./
|
|
|
|
ENTRYPOINT ["./traefik-forward-auth"]
|