-
Notifications
You must be signed in to change notification settings - Fork 36
/
Copy pathDockerfile.arm64
46 lines (31 loc) · 935 Bytes
/
Dockerfile.arm64
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
36
37
38
39
40
41
42
43
44
45
46
# Build the manager binary
FROM node:16-bookworm as builder
COPY --from=golang:1.17 /usr/local/go/ /usr/local/go/
ENV PATH="/usr/local/go/bin:${PATH}"
WORKDIR /workspace
ARG TARGETOS=linux
ARG TARGETARCH=arm64
# Prepare pod
RUN npm install -g webpack-cli
# Copy the Go Modules manifests
COPY go.mod go.mod
COPY go.sum go.sum
COPY vendor/ vendor/
# Copy the go source
COPY cmd/ cmd/
COPY pkg/ pkg/
ENV GO111MODULE on
ENV DEBUG true
# # Build jspolicy
RUN GOOS=${TARGETOS} GOARCH=${TARGETARCH} GO111MODULE=on go build -mod vendor -o jspolicy cmd/jspolicy/main.go
FROM node:16-slim
# Prepare pod
RUN npm install -g webpack-cli
WORKDIR /
COPY --from=builder --chown=node:node /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
COPY --from=builder --chown=node:node /workspace/jspolicy /jspolicy
RUN chown -R node:node /tmp /usr/local/lib/node_modules
# Change to non-root privilege
USER node
ENTRYPOINT ["/jspolicy"]
CMD []