-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
29 lines (18 loc) · 781 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
FROM golang:1.14-alpine as build
ARG TARGETPLATFORM
ENV GO111MODULE=on \
CGO_ENABLED=0
RUN apk add --no-cache git
WORKDIR /go/src/github.com/raspbernetes/custom-error-pages
COPY . .
RUN export GOOS=$(echo ${TARGETPLATFORM} | cut -d / -f1) && \
export GOARCH=$(echo ${TARGETPLATFORM} | cut -d / -f2) && \
GOARM=$(echo ${TARGETPLATFORM} | cut -d / -f3); export GOARM=${GOARM:1} && \
go build -o custom-error-pages main.go metrics.go
# Use distroless as minimal base image to package the manager binary
# Refer to https://github.com/GoogleContainerTools/distroless for more details
FROM gcr.io/distroless/static:nonroot
WORKDIR /
COPY --from=build /go/src/github.com/raspbernetes/custom-error-pages .
USER nonroot:nonroot
ENTRYPOINT ["/custom-error-pages"]