Source
FROM stagex/pallet-gcc-gnu-busybox AS build
ARG VERSION
COPY --from=stagex/core-openssl . /
COPY --from=stagex/core-ncurses . /
COPY --from=stagex/core-readline . /
COPY --from=stagex/user-util-linux . /
COPY --from=stagex/user-pcsc-lite . /
ADD fetch/opensc-${VERSION}.tar.gz .
WORKDIR /OpenSC-${VERSION}
ENV CFLAGS="-U_FORTIFY_SOURCE -Wno-error"
RUN --network=none <<-EOF
set -eux
./bootstrap
./configure \
--prefix=/usr \
--sysconfdir=/etc \
--mandir=/usr/share/man \
--infodir=/usr/share/info \
--localstatedir=/var \
--enable-zlib \
--enable-readline \
--enable-openssl \
--enable-pcsc \
--enable-sm \
--enable-piv-sm
make -j "$(nproc)"
make -C src/tools
make DESTDIR=/rootfs install
install -D -m644 etc/opensc.conf /rootfs/etc/opensc.conf
EOF
FROM stagex/core-filesystem AS package
COPY --from=build /rootfs/ /