From ce909592ad757a21ae7050cd962b0a0de6262109 Mon Sep 17 00:00:00 2001 From: Matthias Wirth Date: Sun, 26 May 2024 18:43:00 +0200 Subject: [PATCH 1/3] mlat-client: make a bunch of packages temporary turns out not all of the packages are necessary for mlat-client to run --- Dockerfile | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index 8603df1..059640b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -17,14 +17,14 @@ RUN set -x && \ # # These are needed to compile and install the mlat_client: KEPT_PACKAGES+=(python3) && \ + KEPT_PACKAGES+=(python3-pkg-resources) && \ TEMP_PACKAGES+=(build-essential) && \ TEMP_PACKAGES+=(debhelper) && \ - KEPT_PACKAGES+=(python3-dev) && \ - KEPT_PACKAGES+=(python3-distutils-extra) && \ - KEPT_PACKAGES+=(python3-pip) && \ - KEPT_PACKAGES+=(python3-setuptools) && \ - KEPT_PACKAGES+=(python3-pkg-resources) && \ - KEPT_PACKAGES+=(python3-wheel) && \ + TEMP_PACKAGES+=(python3-dev) && \ + TEMP_PACKAGES+=(python3-distutils-extra) && \ + TEMP_PACKAGES+=(python3-pip) && \ + TEMP_PACKAGES+=(python3-setuptools) && \ + TEMP_PACKAGES+=(python3-wheel) && \ # # packages needed for debugging - these can stay out in production builds: #KEPT_PACKAGES+=(procps nano aptitude psmisc) && \ From 573646118362988da5edbe92b2c89c91d367d915 Mon Sep 17 00:00:00 2001 From: Matthias Wirth Date: Fri, 31 May 2024 21:16:12 +0200 Subject: [PATCH 2/3] remove py_cache: save 13 MB image size --- Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Dockerfile b/Dockerfile index 059640b..ec080c8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -49,6 +49,7 @@ RUN set -x && \ # apt-get install -o Dpkg::Options::="--force-confnew" -y --no-install-recommends -q \ # ${POST_PACKAGES[@]} && \ apt-get autoremove -q -o APT::Autoremove::RecommendsImportant=0 -o APT::Autoremove::SuggestsImportant=0 -y && \ + find /usr | grep -E "/__pycache__$" | xargs rm -rf || true && \ apt-get clean -q -y && \ rm -rf /src /tmp/* /var/lib/apt/lists/* /git && \ # From bab146593c090e8f19b941abbe5cde9bf3434560 Mon Sep 17 00:00:00 2001 From: Matthias Wirth Date: Fri, 31 May 2024 22:08:58 +0200 Subject: [PATCH 3/3] remove /var/cache/* for minor size savings --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index ec080c8..efab805 100644 --- a/Dockerfile +++ b/Dockerfile @@ -51,7 +51,7 @@ RUN set -x && \ apt-get autoremove -q -o APT::Autoremove::RecommendsImportant=0 -o APT::Autoremove::SuggestsImportant=0 -y && \ find /usr | grep -E "/__pycache__$" | xargs rm -rf || true && \ apt-get clean -q -y && \ - rm -rf /src /tmp/* /var/lib/apt/lists/* /git && \ + rm -rf /src /tmp/* /var/lib/apt/lists/* /git /var/cache/* && \ # # Do some stuff for kx1t's convenience: echo "alias dir=\"ls -alsv\"" >> /root/.bashrc && \