From 72d7408ad3b57ab1a5c371e11460811551811bf5 Mon Sep 17 00:00:00 2001 From: Hakan Dilek Date: Mon, 17 Feb 2020 14:02:34 +0100 Subject: [PATCH] Do not install recommended dependencies This results in a ~80MB image size reduction. --- 10/Dockerfile | 6 +++--- 11/Dockerfile | 6 +++--- 12/Dockerfile | 6 +++--- 9.5/Dockerfile | 6 +++--- 9.6/Dockerfile | 6 +++--- Dockerfile-debian.template | 6 +++--- 6 files changed, 18 insertions(+), 18 deletions(-) diff --git a/10/Dockerfile b/10/Dockerfile index 76b3374d47..f0b0ea58f3 100644 --- a/10/Dockerfile +++ b/10/Dockerfile @@ -44,7 +44,7 @@ RUN set -eux; \ sed -ri '/\/usr\/share\/locale/d' /etc/dpkg/dpkg.cfg.d/docker; \ ! grep -q '/usr/share/locale' /etc/dpkg/dpkg.cfg.d/docker; \ fi; \ - apt-get update; apt-get install -y locales; rm -rf /var/lib/apt/lists/*; \ + apt-get update; apt-get install -y --no-install-recommends locales; rm -rf /var/lib/apt/lists/*; \ localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8 ENV LANG en_US.utf8 @@ -139,9 +139,9 @@ RUN set -ex; \ ;; \ esac; \ \ - apt-get install -y postgresql-common; \ + apt-get install -y --no-install-recommends postgresql-common; \ sed -ri 's/#(create_main_cluster) .*$/\1 = false/' /etc/postgresql-common/createcluster.conf; \ - apt-get install -y \ + apt-get install -y --no-install-recommends \ "postgresql-$PG_MAJOR=$PG_VERSION" \ ; \ \ diff --git a/11/Dockerfile b/11/Dockerfile index c237e0ce18..7fa42ebd33 100644 --- a/11/Dockerfile +++ b/11/Dockerfile @@ -44,7 +44,7 @@ RUN set -eux; \ sed -ri '/\/usr\/share\/locale/d' /etc/dpkg/dpkg.cfg.d/docker; \ ! grep -q '/usr/share/locale' /etc/dpkg/dpkg.cfg.d/docker; \ fi; \ - apt-get update; apt-get install -y locales; rm -rf /var/lib/apt/lists/*; \ + apt-get update; apt-get install -y --no-install-recommends locales; rm -rf /var/lib/apt/lists/*; \ localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8 ENV LANG en_US.utf8 @@ -139,9 +139,9 @@ RUN set -ex; \ ;; \ esac; \ \ - apt-get install -y postgresql-common; \ + apt-get install -y --no-install-recommends postgresql-common; \ sed -ri 's/#(create_main_cluster) .*$/\1 = false/' /etc/postgresql-common/createcluster.conf; \ - apt-get install -y \ + apt-get install -y --no-install-recommends \ "postgresql-$PG_MAJOR=$PG_VERSION" \ ; \ \ diff --git a/12/Dockerfile b/12/Dockerfile index 013d33ab7e..f44eb45d34 100644 --- a/12/Dockerfile +++ b/12/Dockerfile @@ -44,7 +44,7 @@ RUN set -eux; \ sed -ri '/\/usr\/share\/locale/d' /etc/dpkg/dpkg.cfg.d/docker; \ ! grep -q '/usr/share/locale' /etc/dpkg/dpkg.cfg.d/docker; \ fi; \ - apt-get update; apt-get install -y locales; rm -rf /var/lib/apt/lists/*; \ + apt-get update; apt-get install -y --no-install-recommends locales; rm -rf /var/lib/apt/lists/*; \ localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8 ENV LANG en_US.utf8 @@ -139,9 +139,9 @@ RUN set -ex; \ ;; \ esac; \ \ - apt-get install -y postgresql-common; \ + apt-get install -y --no-install-recommends postgresql-common; \ sed -ri 's/#(create_main_cluster) .*$/\1 = false/' /etc/postgresql-common/createcluster.conf; \ - apt-get install -y \ + apt-get install -y --no-install-recommends \ "postgresql-$PG_MAJOR=$PG_VERSION" \ ; \ \ diff --git a/9.5/Dockerfile b/9.5/Dockerfile index ec2f6b8117..5be6757740 100644 --- a/9.5/Dockerfile +++ b/9.5/Dockerfile @@ -44,7 +44,7 @@ RUN set -eux; \ sed -ri '/\/usr\/share\/locale/d' /etc/dpkg/dpkg.cfg.d/docker; \ ! grep -q '/usr/share/locale' /etc/dpkg/dpkg.cfg.d/docker; \ fi; \ - apt-get update; apt-get install -y locales; rm -rf /var/lib/apt/lists/*; \ + apt-get update; apt-get install -y --no-install-recommends locales; rm -rf /var/lib/apt/lists/*; \ localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8 ENV LANG en_US.utf8 @@ -139,9 +139,9 @@ RUN set -ex; \ ;; \ esac; \ \ - apt-get install -y postgresql-common; \ + apt-get install -y --no-install-recommends postgresql-common; \ sed -ri 's/#(create_main_cluster) .*$/\1 = false/' /etc/postgresql-common/createcluster.conf; \ - apt-get install -y \ + apt-get install -y --no-install-recommends \ "postgresql-$PG_MAJOR=$PG_VERSION" \ "postgresql-contrib-$PG_MAJOR=$PG_VERSION" \ ; \ diff --git a/9.6/Dockerfile b/9.6/Dockerfile index fbe2662ea8..c4d6fa6e59 100644 --- a/9.6/Dockerfile +++ b/9.6/Dockerfile @@ -44,7 +44,7 @@ RUN set -eux; \ sed -ri '/\/usr\/share\/locale/d' /etc/dpkg/dpkg.cfg.d/docker; \ ! grep -q '/usr/share/locale' /etc/dpkg/dpkg.cfg.d/docker; \ fi; \ - apt-get update; apt-get install -y locales; rm -rf /var/lib/apt/lists/*; \ + apt-get update; apt-get install -y --no-install-recommends locales; rm -rf /var/lib/apt/lists/*; \ localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8 ENV LANG en_US.utf8 @@ -139,9 +139,9 @@ RUN set -ex; \ ;; \ esac; \ \ - apt-get install -y postgresql-common; \ + apt-get install -y --no-install-recommends postgresql-common; \ sed -ri 's/#(create_main_cluster) .*$/\1 = false/' /etc/postgresql-common/createcluster.conf; \ - apt-get install -y \ + apt-get install -y --no-install-recommends \ "postgresql-$PG_MAJOR=$PG_VERSION" \ "postgresql-contrib-$PG_MAJOR=$PG_VERSION" \ ; \ diff --git a/Dockerfile-debian.template b/Dockerfile-debian.template index 485137f864..63330b2eab 100644 --- a/Dockerfile-debian.template +++ b/Dockerfile-debian.template @@ -44,7 +44,7 @@ RUN set -eux; \ sed -ri '/\/usr\/share\/locale/d' /etc/dpkg/dpkg.cfg.d/docker; \ ! grep -q '/usr/share/locale' /etc/dpkg/dpkg.cfg.d/docker; \ fi; \ - apt-get update; apt-get install -y locales; rm -rf /var/lib/apt/lists/*; \ + apt-get update; apt-get install -y --no-install-recommends locales; rm -rf /var/lib/apt/lists/*; \ localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8 ENV LANG en_US.utf8 @@ -139,9 +139,9 @@ RUN set -ex; \ ;; \ esac; \ \ - apt-get install -y postgresql-common; \ + apt-get install -y --no-install-recommends postgresql-common; \ sed -ri 's/#(create_main_cluster) .*$/\1 = false/' /etc/postgresql-common/createcluster.conf; \ - apt-get install -y \ + apt-get install -y --no-install-recommends \ "postgresql-$PG_MAJOR=$PG_VERSION" \ "postgresql-contrib-$PG_MAJOR=$PG_VERSION" \ ; \