numaflow-rs icon indicating copy to clipboard operation
numaflow-rs copied to clipboard

reduce image size by using to distroless

Open vigith opened this issue 1 year ago • 0 comments

Example,

FROM rust:1.76-bookworm as build

RUN apt-get update
RUN apt-get install protobuf-compiler -y

# create a new empty shell project
WORKDIR /examples

# copy your source tree
COPY src ./src

COPY ./Cargo.toml ./Cargo.toml
COPY ./Cargo.lock ./Cargo.lock

# build for release
RUN cargo build --release

# our final base
FROM gcr.io/distroless/cc-debian12

# copy the build artifact from the build stage
COPY --from=build /examples/target/release/server /

# set the startup command to run your binary
CMD ["/server"]

vigith avatar Feb 18 '24 19:02 vigith