# Build application # # Copy in all crates, Cargo.toml and Cargo.lock unmodified, # and build the application. FROM rust:1.75-bullseye AS builder ARG PROFILE=release ARG GIT_REVISION ENV GIT_REVISION=$GIT_REVISION WORKDIR "$WORKDIR/sui" RUN apt-get update && apt-get install -y cmake clang COPY Cargo.toml Cargo.lock ./ COPY consensus consensus COPY crates crates COPY sui-execution sui-execution COPY narwhal narwhal COPY external-crates external-crates RUN cargo build --profile ${PROFILE} --bin sui-node # Production Image FROM debian:bullseye-slim AS runtime # Use jemalloc as memory allocator RUN apt-get update && apt-get install -y libjemalloc-dev ca-certificates ENV LD_PRELOAD /usr/lib/x86_64-linux-gnu/libjemalloc.so ARG PROFILE=release WORKDIR "$WORKDIR/sui" # Both bench and release profiles copy from release dir COPY --from=builder /sui/target/release/sui-node /opt/sui/bin/sui-node # Support legacy usages of /usr/local/bin/sui-node COPY --from=builder /sui/target/release/sui-node /usr/local/bin ARG BUILD_DATE ARG GIT_REVISION LABEL build-date=$BUILD_DATE LABEL git-revision=$GIT_REVISION