-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
fc289f6
commit c4e3565
Showing
2 changed files
with
51 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
/.dockerignore | ||
.DS_Store | ||
.git/ | ||
/.github/ | ||
/.gitignore | ||
/.goreleaser.yml | ||
/*.env* | ||
/.golangci.yaml | ||
/.vscode/ | ||
/target/ | ||
/CONTRIBUTING.md | ||
/Dockerfile | ||
/docs/ | ||
/LICENSE* | ||
/Makefile.maker.yaml | ||
/README.md | ||
/shell.nix | ||
/tarpaulin-report.html |
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,33 @@ | ||
FROM rust:alpine3.20 AS builder | ||
|
||
COPY Cargo.toml Cargo.lock /src/ | ||
RUN mkdir -p /src/src \ | ||
&& touch /src/src/main.rs \ | ||
&& cargo fetch --locked --manifest-path /src/Cargo.toml | ||
|
||
ENV \ | ||
# TODO: uncomment when libgit2 is at least version 1.8.1 | ||
# LIBGIT2_NO_VENDOR=1 \ | ||
OPENSSL_NO_VENDOR=1 \ | ||
RUSTFLAGS='-C target-feature=-crt-static' | ||
RUN apk add --no-cache --no-progress libgit2-dev musl-dev openssl-dev zlib-dev | ||
|
||
COPY . /src/ | ||
RUN cargo install --locked --path /src --root /pkg \ | ||
&& strip /pkg/bin/pear-reviewer | ||
|
||
################################################################################ | ||
|
||
FROM alpine:3.20 | ||
|
||
# upgrade all installed packages to fix potential CVEs in advance | ||
# also remove apk package manager to hopefully remove dependency on OpenSSL 🤞 | ||
RUN apk upgrade --no-cache --no-progress \ | ||
&& apk add --no-cache --no-progress libgcc libgit2 openssl zlib \ | ||
&& apk del --no-cache --no-progress apk-tools alpine-keys | ||
|
||
COPY --from=builder /pkg/bin/pear-reviewer /usr/bin/pear-reviewer | ||
# make sure the binary can be executed | ||
RUN pear-reviewer --version 2>/dev/null | ||
|
||
ENTRYPOINT [ "/usr/bin/pear-reviewer" ] |