Skip to content

Commit 9d19633

Browse files
authored
feat: run in distroless docker image (#41)
2 parents c5eb3fe + 66f9a05 commit 9d19633

5 files changed

Lines changed: 35 additions & 1 deletion

File tree

.dockerignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
.git
2+
.github
3+
packaged
4+
target
5+

Cargo.lock

Lines changed: 11 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ comrak = { version = "0.28.0", optional = true }
3939
default = ["reqwest/default-tls"] # link against system library
4040
rustls = ["reqwest/rustls-tls", "openidconnect/rustls-tls"] # include rustls, ssl library written in rust
4141
vendored-openssl = ["openssl/vendored"] # include compiled openssl library
42+
vendored-zlib = ["git2/zlib-ng-compat"] # without this feature wherever the cli is installed needs to have zlib.so
4243
user-doc = [ "dep:comrak" ]
4344

4445
[dev-dependencies]

Dockerfile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
FROM rust:bookworm AS builder
2+
WORKDIR /app
3+
COPY . .
4+
RUN apt update && apt install -y cmake
5+
RUN cargo build --release --bin rnk -F vendored-openssl -F vendored-zlib --target-dir /build
6+
7+
FROM gcr.io/distroless/cc-debian12
8+
COPY --from=builder /build/release/rnk /rnk
9+
ENTRYPOINT ["/rnk"]

musl.Dockerfile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
FROM rust:bookworm AS builder
2+
WORKDIR /app
3+
COPY . .
4+
RUN apt update && apt install -y cmake musl-tools
5+
RUN rustup target add x86_64-unknown-linux-musl && cargo build --release --bin rnk -F vendored-openssl -F vendored-zlib --target-dir /build --target=x86_64-unknown-linux-musl
6+
7+
FROM gcr.io/distroless/static
8+
COPY --from=builder /build/x86_64-unknown-linux-musl/release/rnk /rnk
9+
ENTRYPOINT ["/rnk"]

0 commit comments

Comments
 (0)