-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* ci: trigger security build job in PRs * chore: clean up * fix: sonarqube warnings * fix: issue with copying parts of the source code * chore: nit
- Loading branch information
Showing
4 changed files
with
32 additions
and
18 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
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 |
---|---|---|
@@ -1,13 +1,31 @@ | ||
FROM golang:1.21 as builder | ||
WORKDIR /go/src/app | ||
FROM golang:1.21 AS builder | ||
WORKDIR /workspace | ||
COPY go.mod go.sum ./ | ||
RUN go mod download | ||
COPY . . | ||
RUN CGO_ENABLED=0 make build | ||
|
||
FROM scratch | ||
COPY abi/ abi/ | ||
COPY bindings/ bindings/ | ||
COPY cmd/ cmd/ | ||
COPY dashboard/ dashboard/ | ||
COPY gethkeystore/ gethkeystore/ | ||
COPY hdwallet/ hdwallet/ | ||
COPY metrics/ metrics/ | ||
COPY p2p/ p2p/ | ||
COPY proto/ proto/ | ||
COPY rpctypes/ rpctypes/ | ||
COPY util/ util/ | ||
COPY main.go ./ | ||
RUN CGO_ENABLED=0 go build -o polycli main.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=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt | ||
COPY --from=builder /go/src/app/out/polycli /usr/bin/polycli | ||
COPY --from=builder /workspace/polycli /usr/bin/polycli | ||
USER 65532:65532 | ||
ENTRYPOINT ["polycli"] | ||
CMD ["--help"] | ||
CMD ["--help"] | ||
|
||
# How to test this image? | ||
# https://github.com/maticnetwork/polygon-cli/pull/189#discussion_r1464486344 |