18 lines
496 B
Docker
18 lines
496 B
Docker
FROM stagex/pallet-rust@sha256:740b9ed5f2a897d45cafdc806976d84231aa50a64998610750b42a48f8daacab as build
|
|
|
|
ENV TARGET=x86_64-unknown-linux-musl
|
|
ENV RUSTFLAGS="-C target-feature=+crt-static"
|
|
ENV CARGOFLAGS="--locked --all-features --release --target ${TARGET}"
|
|
ENV CARGO_TARGET_DIR=/cargo-target
|
|
|
|
ADD . /src
|
|
|
|
WORKDIR /src
|
|
RUN cargo build ${CARGOFLAGS}
|
|
|
|
WORKDIR /rootfs
|
|
RUN install -Dm755 /cargo-target/${TARGET}/release/nit /rootfs/usr/bin/init
|
|
|
|
FROM scratch as package
|
|
COPY --from=build /rootfs .
|