From 23f807583b8d9300f5fefa812c953ab66dccf75a Mon Sep 17 00:00:00 2001 From: Julian <14220769+Qup42@users.noreply.github.com> Date: Wed, 4 Dec 2024 19:38:21 +0100 Subject: [PATCH] Further reduce the size of the Docker image (#1658) Remove `ppa:mhier/libboost-latest` (no longer needed to install the Boost packages), move some more packages that are only needed for compiling to the respective stage (so that they don't end up in the final image), use the non-dev version of packages in the final image, and only install those Boost packages that are needed to run Qlever. This about halves the image size from almost 800 MB previously to now 400 MB. --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 757cadd25..554435a4b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,13 +6,13 @@ ENV LANG=C.UTF-8 ENV LC_ALL=C.UTF-8 ENV LC_CTYPE=C.UTF-8 ENV DEBIAN_FRONTEND=noninteractive -RUN apt-get update && apt-get install -y software-properties-common wget && add-apt-repository -y ppa:mhier/libboost-latest # Install the packages needed for building the binaries (this is a separate # stage to keep the final image small). FROM base AS builder ARG TARGETPLATFORM ENV DEBIAN_FRONTEND=noninteractive +RUN apt-get update && apt-get install -y wget RUN wget https://apt.kitware.com/kitware-archive.sh && chmod +x kitware-archive.sh && ./kitware-archive.sh RUN apt-get update && apt-get install -y build-essential cmake libicu-dev tzdata pkg-config uuid-runtime uuid-dev git libjemalloc-dev ninja-build libzstd-dev libssl-dev libboost1.83-dev libboost-program-options1.83-dev libboost-iostreams1.83-dev libboost-url1.83-dev @@ -42,7 +42,7 @@ RUN if [ $TARGETPLATFORM = "linux/arm64" ] ; then echo "Skipping tests for ARM64 FROM base AS runtime WORKDIR /qlever ENV DEBIAN_FRONTEND=noninteractive -RUN apt-get update && apt-get install -y wget python3-yaml unzip curl bzip2 pkg-config libicu-dev python3-icu libgomp1 uuid-runtime make lbzip2 libjemalloc-dev libzstd-dev libssl-dev libboost1.83-dev libboost-program-options1.83-dev libboost-iostreams1.83-dev libboost-url1.83-dev pipx bash-completion vim sudo && rm -rf /var/lib/apt/lists/* +RUN apt-get update && apt-get install -y wget python3-yaml unzip curl bzip2 pkg-config libicu74 python3-icu libgomp1 uuid-runtime make lbzip2 libjemalloc2 libzstd1 libboost-program-options1.83.0 libboost-iostreams1.83.0 libboost-url1.83.0 pipx bash-completion vim sudo && rm -rf /var/lib/apt/lists/* # Set up user `qlever` with temporary sudo rights (which will be removed again # by the `docker-entrypoint.sh` script, see there).