simplify containerfile

This commit is contained in:
Lance Vick 2024-03-05 01:48:51 -08:00
parent cec12749a9
commit bd418c55d8
Signed by: lrvick
GPG Key ID: 8E47A1EC35A1551D
1 changed files with 5 additions and 9 deletions

View File

@ -1,6 +1,4 @@
FROM scratch AS base FROM scratch AS build
FROM base AS fetch
COPY --from=stagex/rust . / COPY --from=stagex/rust . /
COPY --from=stagex/busybox . / COPY --from=stagex/busybox . /
COPY --from=stagex/musl . / COPY --from=stagex/musl . /
@ -10,11 +8,6 @@ COPY --from=stagex/libunwind . /
COPY --from=stagex/openssl . / COPY --from=stagex/openssl . /
COPY --from=stagex/zlib . / COPY --from=stagex/zlib . /
COPY --from=stagex/ca-certificates . / COPY --from=stagex/ca-certificates . /
ADD . /src
WORKDIR /src
RUN cargo fetch
FROM fetch AS build
COPY --from=stagex/clang . / COPY --from=stagex/clang . /
COPY --from=stagex/linux-headers . / COPY --from=stagex/linux-headers . /
COPY --from=stagex/gmp . / COPY --from=stagex/gmp . /
@ -22,6 +15,9 @@ COPY --from=stagex/nettle . /
COPY --from=stagex/pcsc-lite . / COPY --from=stagex/pcsc-lite . /
COPY --from=stagex/pkgconf . / COPY --from=stagex/pkgconf . /
COPY --from=stagex/binutils . / COPY --from=stagex/binutils . /
ADD . /src
WORKDIR /src
RUN cargo fetch
ENV NETTLE_STATIC=yes ENV NETTLE_STATIC=yes
ENV PCSC_LIB_NAME=static=pcsclite ENV PCSC_LIB_NAME=static=pcsclite
ENV RUSTFLAGS='-C codegen-units=1' ENV RUSTFLAGS='-C codegen-units=1'
@ -33,5 +29,5 @@ RUN --network=none \
--target x86_64-unknown-linux-musl \ --target x86_64-unknown-linux-musl \
--bin keyfork --bin keyfork
FROM scratch AS install FROM scratch AS package
COPY --from=build keyfork/target/release/keyfork /keyfork COPY --from=build keyfork/target/release/keyfork /keyfork