FROM pyroscope/rust_builder_cli:3 as builder WORKDIR /app ADD pyroscope_backends ./pyroscope_backends ADD pyroscope_cli ./pyroscope_cli ADD pyroscope_ffi ./pyroscope_ffi ADD src ./src ADD Cargo.toml ./Cargo.toml RUN --mount=type=cache,target=/root/.cargo/registry \ cd pyroscope_cli && \ cargo build --release --bin pyroscope-cli FROM scratch as final COPY --from=builder /app/pyroscope_cli/target/release/pyroscope-cli /pyroscope-cli ENTRYPOINT ["/pyroscope-cli"]