-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #124 from bugbounce/build/arm64
Add Dockerfile for building arm64 image
- Loading branch information
Showing
97 changed files
with
3,973 additions
and
2,093 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,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 [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.