24 lines
585 B
Plaintext
24 lines
585 B
Plaintext
FROM rust:1.76-alpine AS build
|
|
|
|
RUN apk add clang-dev nettle-dev linux-headers
|
|
ADD . /src
|
|
WORKDIR /src
|
|
ADD <<-EOF /.cargo/config.toml
|
|
[registries.distrust]
|
|
index = "https://git.distrust.co/public/_cargo-index.git"
|
|
EOF
|
|
RUN cargo fetch
|
|
ENV NETTLE_STATIC=yes
|
|
ENV PCSC_LIB_NAME=static=pcsclite
|
|
ENV RUSTFLAGS='-C codegen-units=1 -C target-features=+crt-static'
|
|
RUN --network=none \
|
|
cargo build \
|
|
--frozen \
|
|
--release \
|
|
--features link-static \
|
|
--target x86_64-alpine-linux-musl \
|
|
--bin keyfork
|
|
|
|
FROM scratch AS package
|
|
COPY --from=build keyfork/target/release/keyfork /keyfork
|