forked from noelcatt/traefik-forward-auth
-
Notifications
You must be signed in to change notification settings - Fork 21
/
Dockerfile
32 lines (25 loc) · 905 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
FROM golang:1.10-alpine as builder
# Now we DO need these, for the auto-labeling of the image
ARG BUILD_DATE
ARG VCS_REF
# Good docker practice, plus we get microbadger badges
LABEL org.label-schema.build-date=$BUILD_DATE \
org.label-schema.vcs-url="https://github.com/funkypenguin/traefik-forward-auth.git" \
org.label-schema.vcs-ref=$VCS_REF \
org.label-schema.schema-version="2.2-r1"
# Setup
RUN mkdir /app
WORKDIR /app
# Add libraries
RUN apk add --no-cache git && \
go get "github.com/namsral/flag" && \
go get "github.com/sirupsen/logrus" && \
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 alpine
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
COPY --from=builder /traefik-forward-auth ./
ENTRYPOINT ["./traefik-forward-auth"]