mirror of
https://github.com/alexgo-io/stacks-puppet-node.git
synced 2026-06-02 14:18:32 +08:00
26 lines
839 B
Docker
26 lines
839 B
Docker
FROM rust:bullseye as build
|
|
|
|
ARG STACKS_NODE_VERSION="No Version Info"
|
|
ARG GIT_BRANCH='No Branch Info'
|
|
ARG GIT_COMMIT='No Commit Info'
|
|
ARG BUILD_DIR=/build
|
|
ARG TARGET=x86_64-unknown-linux-gnu
|
|
WORKDIR /src
|
|
|
|
COPY . .
|
|
|
|
RUN apt-get update && apt-get install -y git libclang-dev
|
|
|
|
# Run all the build steps in ramdisk in an attempt to speed things up
|
|
RUN --mount=type=tmpfs,target=${BUILD_DIR} cp -R /src/. ${BUILD_DIR}/ \
|
|
&& cd ${BUILD_DIR} \
|
|
&& rustup target add ${TARGET} \
|
|
&& rustup component add rustfmt \
|
|
&& cargo build --features monitoring_prom,slog_json --release --workspace --target ${TARGET} \
|
|
&& mkdir -p /out \
|
|
&& cp -R ${BUILD_DIR}/target/${TARGET}/release/. /out
|
|
|
|
FROM --platform=${TARGETPLATFORM} debian:bookworm
|
|
COPY --from=build /out/stacks-node /out/stacks-signer /bin/
|
|
CMD ["stacks-node", "mainnet"]
|