19 lines
645 B
Docker
Raw Normal View History

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
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"]