keyfork/Containerfile

38 lines
985 B
Plaintext
Raw Normal View History

2024-03-05 09:48:51 +00:00
FROM scratch AS build
2024-03-05 09:45:33 +00:00
COPY --from=stagex/rust . /
COPY --from=stagex/busybox . /
COPY --from=stagex/musl . /
COPY --from=stagex/gcc . /
COPY --from=stagex/llvm . /
COPY --from=stagex/libunwind . /
COPY --from=stagex/openssl . /
COPY --from=stagex/zlib . /
COPY --from=stagex/ca-certificates . /
COPY --from=stagex/clang . /
COPY --from=stagex/linux-headers . /
COPY --from=stagex/gmp . /
COPY --from=stagex/nettle . /
COPY --from=stagex/pcsc-lite . /
COPY --from=stagex/pkgconf . /
COPY --from=stagex/binutils . /
2024-03-05 09:48:51 +00:00
ADD . /src
WORKDIR /src
2024-03-05 21:55:40 +00:00
ADD <<-EOF /.cargo/config.toml
[registries.distrust]
index = "https://git.distrust.co/public/_cargo-index.git"
EOF
2024-03-05 09:48:51 +00:00
RUN cargo fetch
2024-03-05 09:45:33 +00:00
ENV NETTLE_STATIC=yes
ENV PCSC_LIB_NAME=static=pcsclite
ENV RUSTFLAGS='-C codegen-units=1'
RUN --network=none \
2024-03-05 21:55:40 +00:00
cargo build \
--frozen \
--release \
--features static \
--target x86_64-unknown-linux-musl \
--bin keyfork
2024-03-05 09:45:33 +00:00
2024-03-05 09:48:51 +00:00
FROM scratch AS package
2024-03-05 09:45:33 +00:00
COPY --from=build keyfork/target/release/keyfork /keyfork