19 lines
632 B
Docker
Raw Permalink Normal View History

FROM golang:1.12-alpine as builder
2018-06-26 12:28:47 +01:00
# Setup
2019-01-30 17:15:40 +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 17:15:40 +00:00
ADD . /go/src/github.com/thomseddon/traefik-forward-auth/
RUN CGO_ENABLED=0 GOOS=linux 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"]