Source
FROM stagex/pallet-rust AS build
ARG VERSION
COPY --from=stagex/core-gmp . /
COPY --from=stagex/user-nettle . /
COPY --from=stagex/user-pcsc-lite . /
ADD fetch/icepick-${VERSION}.tar.gz .
WORKDIR /icepick
ADD <<-EOF /.cargo/config.toml
[registries.distrust]
index = "https://git.distrust.co/public/_cargo-index.git"
EOF
RUN cargo fetch
ENV RUST_BACKTRACE=1
RUN --network=none <<-EOF
set -eux
ARCH="$(uname -m)"
cargo build \
--frozen \
--release \
--target "${ARCH}-unknown-linux-musl"
mkdir -p /rootfs/usr/bin /rootfs/etc/icepick
cp icepick.toml /rootfs/etc/icepick/
find \
target/${ARCH}-unknown-linux-musl \
-type f \
-maxdepth 2 \
-executable \
-exec cp -rvfp {} /rootfs/usr/bin \;
EOF
FROM stagex/core-filesystem AS package
COPY --from=build /rootfs/ /