Skip to content

Commit

Permalink
Use rust:1-bookworm container to build and copy libs
Browse files Browse the repository at this point in the history
NOTE: Run `cargo build --release && ldd target/release/nost` to detect `*.so` files.
  • Loading branch information
kaosf committed May 3, 2024
1 parent 54147ef commit e01513a
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
FROM rust:1-bookworm AS builder
WORKDIR /workspace/
COPY ["Cargo.toml", "Cargo.lock", "/workspace/"]
COPY ["src/", "/workspace/src/"]
RUN cargo build --release

FROM gcr.io/distroless/base
COPY --from=builder ["/lib/x86_64-linux-gnu/libgcc_s.so.1", "/lib/x86_64-linux-gnu/libgcc_s.so.1"]
COPY --from=builder ["/lib/x86_64-linux-gnu/libm.so.6", "/lib/x86_64-linux-gnu/libm.so.6"]
COPY --from=builder ["/lib/x86_64-linux-gnu/libc.so.6", "/lib/x86_64-linux-gnu/libc.so.6"]
COPY --from=builder ["/workspace/target/release/nost", "/bin/nost"]
WORKDIR /workspace/
COPY ["target/release/nost", "/bin/"]
ENTRYPOINT ["nost"]

0 comments on commit e01513a

Please sign in to comment.