forked from geek-cookbook/traefik-forward-auth
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
31 lines (24 loc) · 880 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
FROM golang:1.17-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/Koellewe/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"
# Copy & build
ADD . /app/
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix nocgo -o /traefik-forward-auth .
# Copy into final 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"]