Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: run in distroless docker image #41

Open
wants to merge 1 commit into
base: fix-cloning-repos
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.git
.github
packaged
target

10 changes: 10 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ comrak = { version = "0.28.0", optional = true }
default = ["reqwest/default-tls", "openidconnect/native-tls"] # link against system library
rustls = ["reqwest/rustls-tls", "openidconnect/rustls-tls"] # include rustls, ssl library written in rust
vendored-openssl = ["git2/vendored-openssl", "reqwest/native-tls-vendored"] # include compiled openssl library
vendored-zlib = ["git2/zlib-ng-compat"]
user-doc = [ "dep:comrak" ]

[dev-dependencies]
Expand Down
9 changes: 9 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM rust:bookworm AS builder
WORKDIR /app
COPY . .
RUN apt update && apt install -y cmake
RUN cargo build --release --bin rnk --no-default-features -F vendored-openssl -F vendored-zlib --target-dir /build

FROM gcr.io/distroless/cc-debian12
COPY --from=builder /build/release/rnk /rnk
ENTRYPOINT ["/rnk"]
9 changes: 9 additions & 0 deletions musl.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM rust:bookworm AS builder
WORKDIR /app
COPY . .
RUN apt update && apt install -y cmake musl-tools
RUN rustup target add x86_64-unknown-linux-musl && cargo build --release --bin rnk --no-default-features -F vendored-openssl -F vendored-zlib --target-dir /build --target=x86_64-unknown-linux-musl

FROM gcr.io/distroless/static
COPY --from=builder /build/x86_64-unknown-linux-musl/release/rnk /rnk
ENTRYPOINT ["/rnk"]
Loading