Skip to content

Commit 72d7408

Browse files
hakandilektianon
authored andcommitted
Do not install recommended dependencies
This results in a ~80MB image size reduction.
1 parent 4dc16e4 commit 72d7408

File tree

6 files changed

+18
-18
lines changed

6 files changed

+18
-18
lines changed

10/Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ RUN set -eux; \
4444
sed -ri '/\/usr\/share\/locale/d' /etc/dpkg/dpkg.cfg.d/docker; \
4545
! grep -q '/usr/share/locale' /etc/dpkg/dpkg.cfg.d/docker; \
4646
fi; \
47-
apt-get update; apt-get install -y locales; rm -rf /var/lib/apt/lists/*; \
47+
apt-get update; apt-get install -y --no-install-recommends locales; rm -rf /var/lib/apt/lists/*; \
4848
localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8
4949
ENV LANG en_US.utf8
5050

@@ -139,9 +139,9 @@ RUN set -ex; \
139139
;; \
140140
esac; \
141141
\
142-
apt-get install -y postgresql-common; \
142+
apt-get install -y --no-install-recommends postgresql-common; \
143143
sed -ri 's/#(create_main_cluster) .*$/\1 = false/' /etc/postgresql-common/createcluster.conf; \
144-
apt-get install -y \
144+
apt-get install -y --no-install-recommends \
145145
"postgresql-$PG_MAJOR=$PG_VERSION" \
146146
; \
147147
\

11/Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ RUN set -eux; \
4444
sed -ri '/\/usr\/share\/locale/d' /etc/dpkg/dpkg.cfg.d/docker; \
4545
! grep -q '/usr/share/locale' /etc/dpkg/dpkg.cfg.d/docker; \
4646
fi; \
47-
apt-get update; apt-get install -y locales; rm -rf /var/lib/apt/lists/*; \
47+
apt-get update; apt-get install -y --no-install-recommends locales; rm -rf /var/lib/apt/lists/*; \
4848
localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8
4949
ENV LANG en_US.utf8
5050

@@ -139,9 +139,9 @@ RUN set -ex; \
139139
;; \
140140
esac; \
141141
\
142-
apt-get install -y postgresql-common; \
142+
apt-get install -y --no-install-recommends postgresql-common; \
143143
sed -ri 's/#(create_main_cluster) .*$/\1 = false/' /etc/postgresql-common/createcluster.conf; \
144-
apt-get install -y \
144+
apt-get install -y --no-install-recommends \
145145
"postgresql-$PG_MAJOR=$PG_VERSION" \
146146
; \
147147
\

12/Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ RUN set -eux; \
4444
sed -ri '/\/usr\/share\/locale/d' /etc/dpkg/dpkg.cfg.d/docker; \
4545
! grep -q '/usr/share/locale' /etc/dpkg/dpkg.cfg.d/docker; \
4646
fi; \
47-
apt-get update; apt-get install -y locales; rm -rf /var/lib/apt/lists/*; \
47+
apt-get update; apt-get install -y --no-install-recommends locales; rm -rf /var/lib/apt/lists/*; \
4848
localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8
4949
ENV LANG en_US.utf8
5050

@@ -139,9 +139,9 @@ RUN set -ex; \
139139
;; \
140140
esac; \
141141
\
142-
apt-get install -y postgresql-common; \
142+
apt-get install -y --no-install-recommends postgresql-common; \
143143
sed -ri 's/#(create_main_cluster) .*$/\1 = false/' /etc/postgresql-common/createcluster.conf; \
144-
apt-get install -y \
144+
apt-get install -y --no-install-recommends \
145145
"postgresql-$PG_MAJOR=$PG_VERSION" \
146146
; \
147147
\

9.5/Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ RUN set -eux; \
4444
sed -ri '/\/usr\/share\/locale/d' /etc/dpkg/dpkg.cfg.d/docker; \
4545
! grep -q '/usr/share/locale' /etc/dpkg/dpkg.cfg.d/docker; \
4646
fi; \
47-
apt-get update; apt-get install -y locales; rm -rf /var/lib/apt/lists/*; \
47+
apt-get update; apt-get install -y --no-install-recommends locales; rm -rf /var/lib/apt/lists/*; \
4848
localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8
4949
ENV LANG en_US.utf8
5050

@@ -139,9 +139,9 @@ RUN set -ex; \
139139
;; \
140140
esac; \
141141
\
142-
apt-get install -y postgresql-common; \
142+
apt-get install -y --no-install-recommends postgresql-common; \
143143
sed -ri 's/#(create_main_cluster) .*$/\1 = false/' /etc/postgresql-common/createcluster.conf; \
144-
apt-get install -y \
144+
apt-get install -y --no-install-recommends \
145145
"postgresql-$PG_MAJOR=$PG_VERSION" \
146146
"postgresql-contrib-$PG_MAJOR=$PG_VERSION" \
147147
; \

9.6/Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ RUN set -eux; \
4444
sed -ri '/\/usr\/share\/locale/d' /etc/dpkg/dpkg.cfg.d/docker; \
4545
! grep -q '/usr/share/locale' /etc/dpkg/dpkg.cfg.d/docker; \
4646
fi; \
47-
apt-get update; apt-get install -y locales; rm -rf /var/lib/apt/lists/*; \
47+
apt-get update; apt-get install -y --no-install-recommends locales; rm -rf /var/lib/apt/lists/*; \
4848
localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8
4949
ENV LANG en_US.utf8
5050

@@ -139,9 +139,9 @@ RUN set -ex; \
139139
;; \
140140
esac; \
141141
\
142-
apt-get install -y postgresql-common; \
142+
apt-get install -y --no-install-recommends postgresql-common; \
143143
sed -ri 's/#(create_main_cluster) .*$/\1 = false/' /etc/postgresql-common/createcluster.conf; \
144-
apt-get install -y \
144+
apt-get install -y --no-install-recommends \
145145
"postgresql-$PG_MAJOR=$PG_VERSION" \
146146
"postgresql-contrib-$PG_MAJOR=$PG_VERSION" \
147147
; \

Dockerfile-debian.template

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ RUN set -eux; \
4444
sed -ri '/\/usr\/share\/locale/d' /etc/dpkg/dpkg.cfg.d/docker; \
4545
! grep -q '/usr/share/locale' /etc/dpkg/dpkg.cfg.d/docker; \
4646
fi; \
47-
apt-get update; apt-get install -y locales; rm -rf /var/lib/apt/lists/*; \
47+
apt-get update; apt-get install -y --no-install-recommends locales; rm -rf /var/lib/apt/lists/*; \
4848
localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8
4949
ENV LANG en_US.utf8
5050

@@ -139,9 +139,9 @@ RUN set -ex; \
139139
;; \
140140
esac; \
141141
\
142-
apt-get install -y postgresql-common; \
142+
apt-get install -y --no-install-recommends postgresql-common; \
143143
sed -ri 's/#(create_main_cluster) .*$/\1 = false/' /etc/postgresql-common/createcluster.conf; \
144-
apt-get install -y \
144+
apt-get install -y --no-install-recommends \
145145
"postgresql-$PG_MAJOR=$PG_VERSION" \
146146
"postgresql-contrib-$PG_MAJOR=$PG_VERSION" \
147147
; \

0 commit comments

Comments
 (0)