keyfork/Containerfile

58 lines
3.0 KiB
Plaintext
Raw Permalink Normal View History

2024-03-06 00:02:17 +00:00
FROM stagex/binutils:sx2024.03.0@sha256:3af41227e1fe6a8f9b3df9916ef4876840f33eaa172168e1db1d8f457ba011d5 AS binutils
FROM stagex/busybox:sx2024.03.0@sha256:0978421e294499c7342cd696a766082d6bb1fe3e3a06fc5c0e9daa39e35418ec AS busybox
FROM stagex/ca-certificates:sx2024.03.0@sha256:6746d2d203be3455bfc5ffd5a051c8edb73ecfd7be77c3da5a2973003a30794f AS ca-certificates
FROM stagex/clang:sx2024.03.0@sha256:07da999e6ed9025c266365271c23afda50e21d863f084fc190924d59d02cfb0f AS clang
FROM stagex/gcc:sx2024.03.0@sha256:25798fdde278a9f1f27e4092a1668e93d2766d4f8b089fba38d4684b20a9b0f7 AS gcc
FROM stagex/gmp:sx2024.03.0@sha256:5d22bf80f84a8b9814ee924328f46573cb6c0401721895cc6ab8a39f287574f8 AS gmp
FROM stagex/libunwind:sx2024.03.0@sha256:e74819e47c79f68a008302927ef02a5aa39cf12e859a8dfeccf9d1b4769b4833 AS libunwind
FROM stagex/linux-headers:sx2024.03.0@sha256:4d505f84bd03e75d10c65704934007cf42bbc24ad6e459202690322f412fc254 AS linux-headers
FROM stagex/llvm13:sx2024.03.0@sha256:97d0f3d32f58dca648cd70b0d58364d9bea5170bb99054c0a0b19ef57a7da7b1 AS llvm13
FROM stagex/llvm:sx2024.03.0@sha256:8e361f1da92e956d947e37b6fc0a3951fcc1130863e2d3a9b4fca40ab4fd07f6 AS llvm
FROM stagex/musl-fts:sx2024.03.0@sha256:73c3c4647010f7151c711ed5005ef946c7c1a19c6e8921e057b5dbc15ef9559a AS musl-fts
FROM stagex/musl:sx2024.03.0@sha256:7db05e6817058a512a66ea82f3b99163069424c281363c2e9a48091d0d1d3bd9 AS musl
FROM stagex/musl-obstack:sx2024.03.0@sha256:4b6737815460908f666fa7a8e91138610d0a0909c408165a575ffb42bf21cd66 AS musl-obstack
FROM stagex/nettle:sx2024.03.0@sha256:0eedc4e98e564be570ff00c6e18668e6bd59bced80f87a08bf159fe96404381f AS nettle
FROM stagex/openssl:sx2024.03.0@sha256:1a2f656ced34d1ade99279c5663fcf0ec4f6526bcc50142079ef8adc080be3a9 AS openssl
FROM stagex/pcsc-lite:sx2024.03.0@sha256:e720e1795706c7c8c1db14bf730b10521e3ff42e4bed90addc590f7446aac8af AS pcsc-lite
FROM stagex/pkgconf:sx2024.03.0@sha256:31ce4eddaf4e777ddb51f01923089f3321ec5272ca0aa834d475f644279209b8 AS pkgconf
FROM stagex/rust:sx2024.03.0@sha256:fe22a0fcdb569cb70b8147378463fb6ff800e642be9d50542f8e25a38d90ec7f AS rust
FROM stagex/zlib:sx2024.03.0@sha256:de8f56f3ece28b14d575329bead53fc5318962ae3cb8f161a2d69710f7ec51f4 AS zlib
2024-03-05 09:48:51 +00:00
FROM scratch AS build
2024-03-06 00:02:17 +00:00
COPY --from=rust . /
COPY --from=busybox . /
COPY --from=musl . /
COPY --from=gcc . /
COPY --from=llvm . /
COPY --from=libunwind . /
COPY --from=openssl . /
COPY --from=zlib . /
COPY --from=ca-certificates . /
COPY --from=clang . /
COPY --from=linux-headers . /
COPY --from=gmp . /
COPY --from=nettle . /
COPY --from=pcsc-lite . /
COPY --from=pkgconf . /
COPY --from=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 link-static \
2024-03-05 21:55:40 +00:00
--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-07 00:32:32 +00:00
COPY --from=build /src/target/x86_64-unknown-linux-musl/release/keyfork /keyfork