Skip to content

Commit ef4545c

Browse files
committed
Update to Debian Stretch (slim)
1 parent aeae143 commit ef4545c

File tree

7 files changed

+77
-36
lines changed

7 files changed

+77
-36
lines changed

10/Dockerfile

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# vim:set ft=dockerfile:
2-
FROM debian:stretch
2+
FROM debian:stretch-slim
33

44
RUN set -ex; \
55
if ! command -v gpg > /dev/null; then \
@@ -29,8 +29,15 @@ RUN set -x \
2929
&& apt-get purge -y --auto-remove ca-certificates wget
3030

3131
# make the "en_US.UTF-8" locale so postgres will be utf-8 enabled by default
32-
RUN apt-get update && apt-get install -y locales && rm -rf /var/lib/apt/lists/* \
33-
&& localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8
32+
RUN set -eux; \
33+
if [ -f /etc/dpkg/dpkg.cfg.d/docker ]; then \
34+
# if this file exists, we're likely in "debian:xxx-slim", and locales are thus being excluded so we need to remove that exclusion (since we need locales)
35+
grep -q '/usr/share/locale' /etc/dpkg/dpkg.cfg.d/docker; \
36+
sed -ri '/\/usr\/share\/locale/d' /etc/dpkg/dpkg.cfg.d/docker; \
37+
! grep -q '/usr/share/locale' /etc/dpkg/dpkg.cfg.d/docker; \
38+
fi; \
39+
apt-get update; apt-get install -y locales; rm -rf /var/lib/apt/lists/*; \
40+
localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8
3441
ENV LANG en_US.utf8
3542

3643
RUN mkdir /docker-entrypoint-initdb.d

9.3/Dockerfile

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# vim:set ft=dockerfile:
2-
FROM debian:jessie
2+
FROM debian:stretch-slim
33

44
RUN set -ex; \
55
if ! command -v gpg > /dev/null; then \
@@ -29,8 +29,15 @@ RUN set -x \
2929
&& apt-get purge -y --auto-remove ca-certificates wget
3030

3131
# make the "en_US.UTF-8" locale so postgres will be utf-8 enabled by default
32-
RUN apt-get update && apt-get install -y locales && rm -rf /var/lib/apt/lists/* \
33-
&& localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8
32+
RUN set -eux; \
33+
if [ -f /etc/dpkg/dpkg.cfg.d/docker ]; then \
34+
# if this file exists, we're likely in "debian:xxx-slim", and locales are thus being excluded so we need to remove that exclusion (since we need locales)
35+
grep -q '/usr/share/locale' /etc/dpkg/dpkg.cfg.d/docker; \
36+
sed -ri '/\/usr\/share\/locale/d' /etc/dpkg/dpkg.cfg.d/docker; \
37+
! grep -q '/usr/share/locale' /etc/dpkg/dpkg.cfg.d/docker; \
38+
fi; \
39+
apt-get update; apt-get install -y locales; rm -rf /var/lib/apt/lists/*; \
40+
localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8
3441
ENV LANG en_US.utf8
3542

3643
RUN mkdir /docker-entrypoint-initdb.d
@@ -47,21 +54,21 @@ RUN set -ex; \
4754
apt-key list
4855

4956
ENV PG_MAJOR 9.3
50-
ENV PG_VERSION 9.3.22-1.pgdg80+1
57+
ENV PG_VERSION 9.3.22-1.pgdg90+1
5158

5259
RUN set -ex; \
5360
\
5461
dpkgArch="$(dpkg --print-architecture)"; \
5562
case "$dpkgArch" in \
5663
amd64|i386|ppc64el) \
5764
# arches officialy built by upstream
58-
echo "deb http://apt.postgresql.org/pub/repos/apt/ jessie-pgdg main $PG_MAJOR" > /etc/apt/sources.list.d/pgdg.list; \
65+
echo "deb http://apt.postgresql.org/pub/repos/apt/ stretch-pgdg main $PG_MAJOR" > /etc/apt/sources.list.d/pgdg.list; \
5966
apt-get update; \
6067
;; \
6168
*) \
6269
# we're on an architecture upstream doesn't officially build for
6370
# let's build binaries from their published source packages
64-
echo "deb-src http://apt.postgresql.org/pub/repos/apt/ jessie-pgdg main $PG_MAJOR" > /etc/apt/sources.list.d/pgdg.list; \
71+
echo "deb-src http://apt.postgresql.org/pub/repos/apt/ stretch-pgdg main $PG_MAJOR" > /etc/apt/sources.list.d/pgdg.list; \
6572
\
6673
tempDir="$(mktemp -d)"; \
6774
cd "$tempDir"; \

9.4/Dockerfile

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# vim:set ft=dockerfile:
2-
FROM debian:jessie
2+
FROM debian:stretch-slim
33

44
RUN set -ex; \
55
if ! command -v gpg > /dev/null; then \
@@ -29,8 +29,15 @@ RUN set -x \
2929
&& apt-get purge -y --auto-remove ca-certificates wget
3030

3131
# make the "en_US.UTF-8" locale so postgres will be utf-8 enabled by default
32-
RUN apt-get update && apt-get install -y locales && rm -rf /var/lib/apt/lists/* \
33-
&& localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8
32+
RUN set -eux; \
33+
if [ -f /etc/dpkg/dpkg.cfg.d/docker ]; then \
34+
# if this file exists, we're likely in "debian:xxx-slim", and locales are thus being excluded so we need to remove that exclusion (since we need locales)
35+
grep -q '/usr/share/locale' /etc/dpkg/dpkg.cfg.d/docker; \
36+
sed -ri '/\/usr\/share\/locale/d' /etc/dpkg/dpkg.cfg.d/docker; \
37+
! grep -q '/usr/share/locale' /etc/dpkg/dpkg.cfg.d/docker; \
38+
fi; \
39+
apt-get update; apt-get install -y locales; rm -rf /var/lib/apt/lists/*; \
40+
localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8
3441
ENV LANG en_US.utf8
3542

3643
RUN mkdir /docker-entrypoint-initdb.d
@@ -47,21 +54,21 @@ RUN set -ex; \
4754
apt-key list
4855

4956
ENV PG_MAJOR 9.4
50-
ENV PG_VERSION 9.4.17-1.pgdg80+1
57+
ENV PG_VERSION 9.4.17-1.pgdg90+1
5158

5259
RUN set -ex; \
5360
\
5461
dpkgArch="$(dpkg --print-architecture)"; \
5562
case "$dpkgArch" in \
5663
amd64|i386|ppc64el) \
5764
# arches officialy built by upstream
58-
echo "deb http://apt.postgresql.org/pub/repos/apt/ jessie-pgdg main $PG_MAJOR" > /etc/apt/sources.list.d/pgdg.list; \
65+
echo "deb http://apt.postgresql.org/pub/repos/apt/ stretch-pgdg main $PG_MAJOR" > /etc/apt/sources.list.d/pgdg.list; \
5966
apt-get update; \
6067
;; \
6168
*) \
6269
# we're on an architecture upstream doesn't officially build for
6370
# let's build binaries from their published source packages
64-
echo "deb-src http://apt.postgresql.org/pub/repos/apt/ jessie-pgdg main $PG_MAJOR" > /etc/apt/sources.list.d/pgdg.list; \
71+
echo "deb-src http://apt.postgresql.org/pub/repos/apt/ stretch-pgdg main $PG_MAJOR" > /etc/apt/sources.list.d/pgdg.list; \
6572
\
6673
tempDir="$(mktemp -d)"; \
6774
cd "$tempDir"; \

9.5/Dockerfile

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# vim:set ft=dockerfile:
2-
FROM debian:jessie
2+
FROM debian:stretch-slim
33

44
RUN set -ex; \
55
if ! command -v gpg > /dev/null; then \
@@ -29,8 +29,15 @@ RUN set -x \
2929
&& apt-get purge -y --auto-remove ca-certificates wget
3030

3131
# make the "en_US.UTF-8" locale so postgres will be utf-8 enabled by default
32-
RUN apt-get update && apt-get install -y locales && rm -rf /var/lib/apt/lists/* \
33-
&& localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8
32+
RUN set -eux; \
33+
if [ -f /etc/dpkg/dpkg.cfg.d/docker ]; then \
34+
# if this file exists, we're likely in "debian:xxx-slim", and locales are thus being excluded so we need to remove that exclusion (since we need locales)
35+
grep -q '/usr/share/locale' /etc/dpkg/dpkg.cfg.d/docker; \
36+
sed -ri '/\/usr\/share\/locale/d' /etc/dpkg/dpkg.cfg.d/docker; \
37+
! grep -q '/usr/share/locale' /etc/dpkg/dpkg.cfg.d/docker; \
38+
fi; \
39+
apt-get update; apt-get install -y locales; rm -rf /var/lib/apt/lists/*; \
40+
localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8
3441
ENV LANG en_US.utf8
3542

3643
RUN mkdir /docker-entrypoint-initdb.d
@@ -47,21 +54,21 @@ RUN set -ex; \
4754
apt-key list
4855

4956
ENV PG_MAJOR 9.5
50-
ENV PG_VERSION 9.5.12-1.pgdg80+1
57+
ENV PG_VERSION 9.5.12-1.pgdg90+1
5158

5259
RUN set -ex; \
5360
\
5461
dpkgArch="$(dpkg --print-architecture)"; \
5562
case "$dpkgArch" in \
5663
amd64|i386|ppc64el) \
5764
# arches officialy built by upstream
58-
echo "deb http://apt.postgresql.org/pub/repos/apt/ jessie-pgdg main $PG_MAJOR" > /etc/apt/sources.list.d/pgdg.list; \
65+
echo "deb http://apt.postgresql.org/pub/repos/apt/ stretch-pgdg main $PG_MAJOR" > /etc/apt/sources.list.d/pgdg.list; \
5966
apt-get update; \
6067
;; \
6168
*) \
6269
# we're on an architecture upstream doesn't officially build for
6370
# let's build binaries from their published source packages
64-
echo "deb-src http://apt.postgresql.org/pub/repos/apt/ jessie-pgdg main $PG_MAJOR" > /etc/apt/sources.list.d/pgdg.list; \
71+
echo "deb-src http://apt.postgresql.org/pub/repos/apt/ stretch-pgdg main $PG_MAJOR" > /etc/apt/sources.list.d/pgdg.list; \
6572
\
6673
tempDir="$(mktemp -d)"; \
6774
cd "$tempDir"; \

9.6/Dockerfile

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# vim:set ft=dockerfile:
2-
FROM debian:jessie
2+
FROM debian:stretch-slim
33

44
RUN set -ex; \
55
if ! command -v gpg > /dev/null; then \
@@ -29,8 +29,15 @@ RUN set -x \
2929
&& apt-get purge -y --auto-remove ca-certificates wget
3030

3131
# make the "en_US.UTF-8" locale so postgres will be utf-8 enabled by default
32-
RUN apt-get update && apt-get install -y locales && rm -rf /var/lib/apt/lists/* \
33-
&& localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8
32+
RUN set -eux; \
33+
if [ -f /etc/dpkg/dpkg.cfg.d/docker ]; then \
34+
# if this file exists, we're likely in "debian:xxx-slim", and locales are thus being excluded so we need to remove that exclusion (since we need locales)
35+
grep -q '/usr/share/locale' /etc/dpkg/dpkg.cfg.d/docker; \
36+
sed -ri '/\/usr\/share\/locale/d' /etc/dpkg/dpkg.cfg.d/docker; \
37+
! grep -q '/usr/share/locale' /etc/dpkg/dpkg.cfg.d/docker; \
38+
fi; \
39+
apt-get update; apt-get install -y locales; rm -rf /var/lib/apt/lists/*; \
40+
localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8
3441
ENV LANG en_US.utf8
3542

3643
RUN mkdir /docker-entrypoint-initdb.d
@@ -47,21 +54,21 @@ RUN set -ex; \
4754
apt-key list
4855

4956
ENV PG_MAJOR 9.6
50-
ENV PG_VERSION 9.6.8-1.pgdg80+1
57+
ENV PG_VERSION 9.6.8-1.pgdg90+1
5158

5259
RUN set -ex; \
5360
\
5461
dpkgArch="$(dpkg --print-architecture)"; \
5562
case "$dpkgArch" in \
5663
amd64|i386|ppc64el) \
5764
# arches officialy built by upstream
58-
echo "deb http://apt.postgresql.org/pub/repos/apt/ jessie-pgdg main $PG_MAJOR" > /etc/apt/sources.list.d/pgdg.list; \
65+
echo "deb http://apt.postgresql.org/pub/repos/apt/ stretch-pgdg main $PG_MAJOR" > /etc/apt/sources.list.d/pgdg.list; \
5966
apt-get update; \
6067
;; \
6168
*) \
6269
# we're on an architecture upstream doesn't officially build for
6370
# let's build binaries from their published source packages
64-
echo "deb-src http://apt.postgresql.org/pub/repos/apt/ jessie-pgdg main $PG_MAJOR" > /etc/apt/sources.list.d/pgdg.list; \
71+
echo "deb-src http://apt.postgresql.org/pub/repos/apt/ stretch-pgdg main $PG_MAJOR" > /etc/apt/sources.list.d/pgdg.list; \
6572
\
6673
tempDir="$(mktemp -d)"; \
6774
cd "$tempDir"; \

Dockerfile-debian.template

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# vim:set ft=dockerfile:
2-
FROM debian:%%DEBIAN_SUITE%%
2+
FROM debian:%%DEBIAN_TAG%%
33

44
RUN set -ex; \
55
if ! command -v gpg > /dev/null; then \
@@ -29,8 +29,15 @@ RUN set -x \
2929
&& apt-get purge -y --auto-remove ca-certificates wget
3030

3131
# make the "en_US.UTF-8" locale so postgres will be utf-8 enabled by default
32-
RUN apt-get update && apt-get install -y locales && rm -rf /var/lib/apt/lists/* \
33-
&& localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8
32+
RUN set -eux; \
33+
if [ -f /etc/dpkg/dpkg.cfg.d/docker ]; then \
34+
# if this file exists, we're likely in "debian:xxx-slim", and locales are thus being excluded so we need to remove that exclusion (since we need locales)
35+
grep -q '/usr/share/locale' /etc/dpkg/dpkg.cfg.d/docker; \
36+
sed -ri '/\/usr\/share\/locale/d' /etc/dpkg/dpkg.cfg.d/docker; \
37+
! grep -q '/usr/share/locale' /etc/dpkg/dpkg.cfg.d/docker; \
38+
fi; \
39+
apt-get update; apt-get install -y locales; rm -rf /var/lib/apt/lists/*; \
40+
localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8
3441
ENV LANG en_US.utf8
3542

3643
RUN mkdir /docker-entrypoint-initdb.d

update.sh

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,9 @@ if [ ${#versions[@]} -eq 0 ]; then
99
fi
1010
versions=( "${versions[@]%/}" )
1111

12+
defaultDebianSuite='stretch-slim'
1213
declare -A debianSuite=(
13-
[9.3]='jessie'
14-
[9.4]='jessie'
15-
[9.5]='jessie'
16-
[9.6]='jessie'
17-
[10]='stretch'
14+
#[9.6]='jessie'
1815
)
1916
declare -A alpineVersion=(
2017
[9.3]='3.5'
@@ -33,7 +30,8 @@ osspUuidHash='11a615225baa5f8bb686824423f50e4427acd3f70d394765bdff32801f0fd5b0'
3330
declare -A suitePackageList=() suiteArches=()
3431
travisEnv=
3532
for version in "${versions[@]}"; do
36-
suite="${debianSuite[$version]}"
33+
tag="${debianSuite[$version]:-$defaultDebianSuite}"
34+
suite="${tag%%-slim}"
3735
if [ -z "${suitePackageList["$suite"]:+isset}" ]; then
3836
suitePackageList["$suite"]="$(curl -fsSL "${packagesBase}/${suite}-pgdg/main/binary-amd64/Packages.bz2" | bunzip2)"
3937
fi
@@ -50,6 +48,7 @@ for version in "${versions[@]}"; do
5048
cp docker-entrypoint.sh "$version/"
5149
sed -e 's/%%PG_MAJOR%%/'"$version"'/g;' \
5250
-e 's/%%PG_VERSION%%/'"$fullVersion"'/g' \
51+
-e 's/%%DEBIAN_TAG%%/'"$tag"'/g' \
5352
-e 's/%%DEBIAN_SUITE%%/'"$suite"'/g' \
5453
-e 's/%%ARCH_LIST%%/'"${suiteArches["$suite"]}"'/g' \
5554
Dockerfile-debian.template > "$version/Dockerfile"

0 commit comments

Comments
 (0)