# use "sid" for riscv64 ARG DEBIAN_VERSION=bookworm-backports FROM debian:${DEBIAN_VERSION} AS ssl3_debian WORKDIR /build SHELL ["/bin/bash", "-exc"] ARG REVISION="1.0.0.0-SNAPSHOT" # amd64, i386, ppc64el, riscv64, armhf, arm64 ARG ARCH_DEBIAN # x86_64, i386, powerpc64le, riscv64, arm, aarch64 ARG ARCH_TRIPLE # gnu, gnueabihf (armhf) ARG TRIPLE_GNU ARG NATIVE="false" ARG SCCACHE_GHA_ENABLED=off ARG ACTIONS_CACHE_URL ARG ACTIONS_RUNTIME_TOKEN # Check for mandatory build arguments RUN : "${ARCH_DEBIAN:?Build argument needs to be set and non-empty.}" RUN : "${ARCH_TRIPLE:?Build argument needs to be set and non-empty.}" RUN : "${TRIPLE_GNU:?Build argument needs to be set and non-empty.}" RUN rm -f /etc/apt/apt.conf.d/docker-clean; echo 'Binary::apt::APT::Keep-Downloaded-Packages "true";' > /etc/apt/apt.conf.d/keep-cache ENV DEBIAN_FRONTEND=noninteractive COPY .docker ./.docker # Install sccache to greatly speedup builds in the CI RUN --mount=type=cache,target=/opt/sccache,sharing=locked --mount=type=cache,target=/var/lib/apt,sharing=locked --mount=type=cache,target=/var/cache/sccache2,sharing=locked .docker/install-sccache.sh RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \ --mount=type=cache,target=/var/lib/apt,sharing=locked \ --mount=type=cache,target=/var/cache/sccache2,sharing=locked <<"EOF" dpkg --add-architecture ${ARCH_DEBIAN} apt-get --assume-yes update apt-get --assume-yes -o Dpkg::Options::="--force-overwrite" install --no-install-recommends openjdk-17-jdk-headless if [[ "$NATIVE" != "true" ]]; then ./.docker/downloadthis.sh /var/cache/apt/downloaded_tmp libssl-dev:${ARCH_DEBIAN} /root/cross-build-pkgs/ ./.docker/downloadthis.sh /var/cache/apt/downloaded_tmp libssl3:${ARCH_DEBIAN} /root/cross-build-pkgs/ ./.docker/downloadthis.sh /var/cache/apt/downloaded_tmp zlib1g-dev:${ARCH_DEBIAN} /root/cross-build-pkgs/ ./.docker/downloadthis.sh /var/cache/apt/downloaded_tmp zlib1g:${ARCH_DEBIAN} /root/cross-build-pkgs/ ./.docker/downloadthis.sh /var/cache/apt/downloaded_tmp openjdk-17-jre-headless:${ARCH_DEBIAN} /root/cross-build-pkgs/ ./.docker/downloadthis.sh /var/cache/apt/downloaded_tmp openjdk-17-jdk-headless:${ARCH_DEBIAN} /root/cross-build-pkgs/ ./.docker/SymlinkPrefix.javash "/root/cross-build-pkgs/" "/" "./" fi apt-get --assume-yes -o Dpkg::Options::="--force-overwrite" install --no-install-recommends \ g++-12 gcc-12 libstdc++-12-dev zlib1g-dev libssl-dev gperf \ tree git maven php-cli php-readline make cmake if [[ "$NATIVE" != "true" ]]; then apt-get --assume-yes -o Dpkg::Options::="--force-overwrite" install --no-install-recommends \ g++-12-${ARCH_TRIPLE/_/-}-linux-${TRIPLE_GNU} gcc-12-${ARCH_TRIPLE/_/-}-linux-${TRIPLE_GNU} \ libatomic1-${ARCH_DEBIAN}-cross libc6-dev-${ARCH_DEBIAN}-cross libgcc-12-dev-${ARCH_DEBIAN}-cross libstdc++-12-dev-${ARCH_DEBIAN}-cross fi EOF FROM ssl3_debian AS build SHELL ["/bin/bash", "-exc"] ARG REVISION="1.0.0.0-SNAPSHOT" ARG ARCH_DEBIAN ARG ARCH_TRIPLE ARG TRIPLE_GNU ARG NATIVE=false ARG SCCACHE_GHA_ENABLED=off ARG ACTIONS_CACHE_URL ARG ACTIONS_RUNTIME_TOKEN ENV SCCACHE_DIR=/var/cache/sccache2 # Use c++11 ENV CMAKE_CXX_FLAGS="${CMAKE_CXX_FLAGS}" ENV CC="/usr/bin/gcc-12" ENV CXX="/usr/bin/g++-12" ENV CMAKE_C_FLAGS="${CMAKE_C_FLAGS}" ENV CMAKE_CXX_FLAGS="${CMAKE_CXX_FLAGS} -fno-omit-frame-pointer -ffunction-sections -fdata-sections -fno-exceptions -fno-rtti" ENV CMAKE_SHARED_LINKER_FLAGS="${CMAKE_SHARED_LINKER_FLAGS} -Wl,--gc-sections -Wl,--exclude-libs,ALL" ENV CMAKE_CXX_FLAGS="${CMAKE_CXX_FLAGS} -flto -O3" ENV CCACHE=/opt/sccache/sccache ENV JAVA_HOME=/usr/lib/jvm/java-17-openjdk-amd64 COPY --link . ./ COPY <