-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathDockerfile.arm64v8
35 lines (33 loc) · 1.26 KB
/
Dockerfile.arm64v8
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
33
34
35
FROM alpine:3.11 AS qemu
RUN apk --update add --no-cache curl
RUN cd /tmp && \
curl -L https://github.com/balena-io/qemu/releases/download/v3.0.0%2Bresin/qemu-3.0.0+resin-aarch64.tar.gz | tar zxvf - -C . && mv qemu-3.0.0+resin-aarch64/qemu-aarch64-static .
FROM arm64v8/golang:1.14-alpine AS builder
COPY --from=qemu /tmp/qemu-aarch64-static /usr/bin/
RUN apk --update add --no-cache git
RUN export GOBIN=$HOME/work/bin
WORKDIR /go/src/app
ADD src/ .
RUN go get -d -v ./...
RUN CGO_ENABLED=0 go build -o main .
FROM arm64v8/alpine:3.11
ARG BUILD_DATE
ARG VCS_REF
ARG VERSION
LABEL org.label-schema.build-date=$BUILD_DATE \
org.label-schema.name="JWT Auth Proxy" \
org.label-schema.description="A lightweight authentication proxy written in Go designed for use in Docker/Kubernetes environments." \
org.label-schema.vcs-ref=$VCS_REF \
org.label-schema.vcs-url="https://github.com/virtualzone/jwt-auth-proxy" \
org.label-schema.version=$VERSION \
org.label-schema.schema-version="1.0"
COPY --from=qemu /tmp/qemu-aarch64-static /usr/bin/
RUN adduser -S -D -H -h /app appuser
COPY --from=builder /go/src/app/main /app/
ADD res/ /app/res/
RUN mkdir /app/certs
RUN chown -R appuser /app
USER appuser
VOLUME /app/certs
WORKDIR /app
CMD ["./main"]