2018-06-26 12:28:47 +01:00
|
|
|
FROM golang:1.10-alpine as builder
|
|
|
|
|
|
|
|
# Setup
|
|
|
|
RUN mkdir /app
|
|
|
|
WORKDIR /app
|
|
|
|
|
|
|
|
# Add libraries
|
|
|
|
RUN apk add --no-cache git && \
|
|
|
|
go get "github.com/namsral/flag" && \
|
|
|
|
go get "github.com/op/go-logging" && \
|
|
|
|
apk del git
|
|
|
|
|
|
|
|
# Copy & build
|
|
|
|
ADD . /app/
|
|
|
|
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix nocgo -o /traefik-forward-auth .
|
|
|
|
|
|
|
|
# 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"]
|