# docker build . FROM rust:1.70.0-slim-buster as rust-dev-env RUN rustup component add clippy rustfmt RUN apt-get update && apt-get install -y \ pkg-config \ libssl-dev \ && apt-get clean && rm -rf /var/lib/apt/lists/* FROM rust-dev-env as build-dependencies # Build and cache dependencies RUN USER=root cargo new --bin signatory-client-lib WORKDIR /signatory-client-lib COPY ./Cargo.lock ./Cargo.lock COPY ./Cargo.toml ./Cargo.toml RUN cargo build --release RUN rm -rf src target/release/signatory-client-lib* target/release/deps/signatory_client_lib* FROM build-dependencies as build COPY ./src ./src RUN cargo build --release FROM build as check RUN cargo clippy --all-targets --all-features -- -D warnings RUN cargo test --release RUN cargo fmt --check