24 lines
756 B
Docker
Raw Normal View History

2018-06-26 12:28:47 +01:00
FROM golang:1.10-alpine as builder
# 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 && \
2019-01-30 17:15:40 +00:00
go get "github.com/BurntSushi/toml" && \
go get "github.com/gorilla/mux" && \
2018-06-26 12:28:47 +01:00
go get "github.com/namsral/flag" && \
2019-01-22 12:59:29 +00:00
go get "github.com/sirupsen/logrus" && \
2018-06-26 12:28:47 +01:00
apk del git
# Copy & build
2019-01-30 17:15:40 +00:00
ADD . /go/src/github.com/thomseddon/traefik-forward-auth/
2018-06-26 12:28:47 +01:00
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"]