From c199843a28c629c27d2e0264124e20d8a2b10c79 Mon Sep 17 00:00:00 2001 From: ryan Date: Wed, 6 Mar 2024 14:36:22 -0500 Subject: [PATCH] Containerfile.alpine: add temporary for checking rust bindgen builds --- Containerfile.alpine | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 Containerfile.alpine diff --git a/Containerfile.alpine b/Containerfile.alpine new file mode 100644 index 0000000..aa2275b --- /dev/null +++ b/Containerfile.alpine @@ -0,0 +1,23 @@ +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