forked from thomseddon/traefik-forward-auth
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.arm64
More file actions
32 lines (28 loc) · 1.05 KB
/
Copy pathDockerfile.arm64
File metadata and controls
32 lines (28 loc) · 1.05 KB
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.13-alpine as builder
# Setup
RUN mkdir -p /go/src/github.com/thomseddon/traefik-forward-auth
WORKDIR /go/src/github.com/thomseddon/traefik-forward-auth
# Add libraries
RUN apk add --no-cache git
# Copy & build
ADD . /go/src/github.com/thomseddon/traefik-forward-auth/
RUN set -ex; \
\
apkArch="$(apk --print-arch)"; \
case "$apkArch" in \
armv[567]) Arch="arm" ;; \
aarch64) Arch='arm64' ;; \
armhf) Arch='arm' ;; \
ppc64le) Arch='ppc64le' ;; \
s390x) Arch='s390x' ;; \
x86) Arch='386' ;; \
x86_64) Arch='amd64' ;; \
*) echo >&2 "error: unsupported architecture: $apkArch"; exit 1 ;; \
esac; \
\
CGO_ENABLED=0 GOOS=linux GOARCH=${Arch} GO111MODULE=on go build -a -installsuffix nocgo -o /traefik-forward-auth github.com/thomseddon/traefik-forward-auth/cmd
# Copy into scratch container
FROM scratch
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
COPY --from=builder /traefik-forward-auth ./
ENTRYPOINT ["./traefik-forward-auth"]