FROM ghcr.io/linuxserver/baseimage-alpine:3.22 AS builder COPY /patches /patches ENV PATCH_VERSION=21 \ APK_BRANCH=3.22-stable \ HOME=/config RUN \ echo "**** build deps ****" && \ apk add \ alpine-sdk RUN \ echo "**** setup abuild ****" && \ sed '/SUDO=/d' -i /usr/bin/abuild-keygen && \ abuild-keygen --install -n RUN \ echo "**** get and build apkbuild ****" && \ abuild-keygen -a -n && \ git clone \ --depth 1 \ --branch ${APK_BRANCH} \ https://gitlab.alpinelinux.org/alpine/aports.git && \ cd aports/community/xorg-server/ && \ cp \ /patches/${PATCH_VERSION}-xvfb-dri3.patch \ patch.patch && \ sed -i \ '/^source="/,/"/ s/missing-files.patch/&\n patch.patch/' \ APKBUILD && \ sed -i \ '/^sha512sums="/,/"$/{ s|\( .*\.tar\.xz\)|\1\n'"$(sha512sum patch.patch)"'|; }' \ APKBUILD && \ abuild -F -r || : && \ tar -xf /config/packages/community/*/xvfb*.apk && \ mkdir -p /build-out/usr/bin && \ mv usr/bin/Xvfb /build-out/usr/bin/ # runtime stage FROM scratch COPY --from=builder /build-out /