From 9fc5582f61ff2742ba923197e15c425dc07d8bf1 Mon Sep 17 00:00:00 2001 From: plowsof Date: Mon, 30 Sep 2024 22:47:15 +0100 Subject: [PATCH] sanity sanity check --- Dockerfile.linux | 66 +++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 65 insertions(+), 1 deletion(-) diff --git a/Dockerfile.linux b/Dockerfile.linux index fec30cef7e..fee1cd49e2 100644 --- a/Dockerfile.linux +++ b/Dockerfile.linux @@ -1,6 +1,6 @@ #todo pin hash of shared_functions.sh -# Stage 1: Confirm provided deb md5sums +# Stage 1: Compare hardcode debs vs APT suggested with original package list FROM ubuntu:16.04@sha256:1f1a2d56de1d604801a9671f301190704c25d604a416f59e03c04f5c6ffee0d6 as checkaptdebs ENV SOURCE_DATE_EPOCH=1397818193 @@ -10,3 +10,67 @@ RUN chmod +x shared_functions.sh # Single CMD with all required commands RUN /bin/bash -c "source shared_functions.sh && check_debs" #todo: improve function name + +# Stage 2: Confirm provided deb md5sums +FROM ubuntu:16.04@sha256:1f1a2d56de1d604801a9671f301190704c25d604a416f59e03c04f5c6ffee0d6 as verifypackages + +ENV SOURCE_DATE_EPOCH=1397818193 + +RUN apt-get update && \ + apt-get install -y gnupg2 xz-utils wget + +COPY shared_functions.sh shared_functions.sh +RUN chmod +x shared_functions.sh + +# Single CMD with all required commands +RUN /bin/bash -c "source shared_functions.sh && verify_packages" #todo: improve function name + +# Stage 3: Downloader +FROM ubuntu:16.04@sha256:1f1a2d56de1d604801a9671f301190704c25d604a416f59e03c04f5c6ffee0d6 as downloader + +ENV SOURCE_DATE_EPOCH=1397818193 + +WORKDIR /sources + +COPY shared_functions.sh /sources/shared_functions.sh +RUN chmod +x /sources/shared_functions.sh + +# Single CMD with all required commands +RUN /bin/bash -c "source shared_functions.sh && get_debs_downloader && download_all_tarballs" + +# Stage 4: Git Cloner +FROM ubuntu:16.04@sha256:1f1a2d56de1d604801a9671f301190704c25d604a416f59e03c04f5c6ffee0d6 as gitcloner + +ARG QT_VERSION=v5.15.14-lts-lgpl +ENV SOURCE_DATE_EPOCH=1397818193 + +WORKDIR /sources + +COPY shared_functions.sh /sources/shared_functions.sh +RUN chmod +x /sources/shared_functions.sh + +RUN /bin/bash -c "source shared_functions.sh && get_debs_gitcloner" +RUN --network=none /bin/bash -c "source shared_functions.sh && install_debs_gitcloner" +RUN /bin/bash -c "source shared_functions.sh && clone_git_repos" + +# Stage 5: Builder +FROM ubuntu:16.04@sha256:1f1a2d56de1d604801a9671f301190704c25d604a416f59e03c04f5c6ffee0d6 as builder + +ARG THREADS=3 + +ENV CFLAGS="-fPIC" +ENV CPPFLAGS="-fPIC" +ENV CXXFLAGS="-fPIC" + +WORKDIR /sources + +# Copy sources from downloader and gitcloner stages +COPY --from=downloader /sources /sources +COPY --from=gitcloner /sources /sources + +COPY shared_functions.sh /sources/shared_functions.sh +RUN chmod +x /sources/shared_functions.sh + +# Build with --network=none +RUN /bin/bash -c "ls -la" +RUN --network=none /bin/bash -c "source shared_functions.sh && install_debs_downloader && install_debs_tarballs && extract_all_tarballs && build_all"