8000 Minor whitespace and consistency changes · techboost/postgres@439c497 · GitHub
[go: up one dir, main page]

Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 439c497

Browse files
committed
Minor whitespace and consistency changes
1 parent 6e1d6d6 commit 439c497

File tree

8 files changed

+81
-39
lines changed

8 files changed

+81
-39
lines changed

9.2/alpine/Dockerfile

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ RUN set -ex \
3939
\
4040
&& apk add --no-cache --virtual .build-deps \
4141
bison \
42+
coreutils \
4243
flex \
4344
gcc \
4445
# krb5-dev \
@@ -57,7 +58,9 @@ RUN set -ex \
5758
util-linux-dev \
5859
zlib-dev \
5960
\
60-
&& wget -O uuid.tar.gz "http://www.mirrorservice.org/sites/ftp.ossp.org/pkg/lib/uuid/uuid-$OSSP_UUID_VERSION.tar.gz" \
61+
# install OSSP uuid (http://www.ossp.org/pkg/lib/uuid/)
62+
# see https://github.com/docker-library/postgres/pull/255 for more details
63+
&& wget -O uuid.tar.gz "https://www.mirrorservice.org/sites/ftp.ossp.org/pkg/lib/uuid/uuid-$OSSP_UUID_VERSION.tar.gz" \
6164
&& echo "$OSSP_UUID_SHA256 *uuid.tar.gz" | sha256sum -c - \
6265
&& mkdir -p /usr/src/ossp-uuid \
6366
&& tar \
@@ -66,13 +69,15 @@ RUN set -ex \
6669
--directory /usr/src/ossp-uuid \
6770
--strip-components 1 \
6871
&& rm uuid.tar.gz \
69-
&& cd /usr/src/ossp-uuid \
70-
&& ./configure \
71-
--prefix=/usr \
72-
&& make -j "$(getconf _NPROCESSORS_ONLN)"\
73-
&& make install \
74-
&& cd / \
72+
&& ( \
73+
cd /usr/src/ossp-uuid \
74+
&& ./configure \
75+
--prefix=/usr/local \
76+
&& make -j "$(nproc)" \
77+
&& make install \
78+
) \
7579
&& rm -rf /usr/src/ossp-uuid \
80+
\
7681
&& cd /usr/src/postgresql \
7782
# update "DEFAULT_PGSOCKET_DIR" to "/var/run/postgresql" (matching Debian)
7883
# see https://anonscm.debian.org/git/pkg-postgresql/postgresql.git/tree/debian/patches/51-default-sockets-in-var.patch?id=8b539fcb3e093a521c095e70bdfa76887217b89f
@@ -94,6 +99,8 @@ RUN set -ex \
9499
--with-pgport=5432 \
95100
--with-system-tzdata=/usr/share/zoneinfo \
96101
--prefix=/usr/local \
102+
--with-includes=/usr/local/include \
103+
--with-libraries=/usr/local/lib \
97104
\
98105
# these make our image abnormally large (at least 100MB larger), which seems uncouth for an "Alpine" (ie, "small") variant :)
99106
# --with-krb5 \
@@ -106,7 +113,7 @@ RUN set -ex \
106113
--with-openssl \
107114
--with-libxml \
108115
--with-libxslt \
109-
&& make -j "$(getconf _NPROCESSORS_ONLN)" world \
116+
&& make -j "$(nproc)" world \
110117
&& make install-world \
111118
&& make -C contrib install \
112119
\

9.3/alpine/Dockerfile

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ RUN set -ex \
3939
\
4040
&& apk add --no-cache --virtual .build-deps \
4141
bison \
42+
coreutils \
4243
flex \
4344
gcc \
4445
# krb5-dev \
@@ -57,7 +58,9 @@ RUN set -ex \
5758
util-linux-dev \
5859
zlib-dev \
5960
\
60-
&& wget -O uuid.tar.gz "http://www.mirrorservice.org/sites/ftp.ossp.org/pkg/lib/uuid/uuid-$OSSP_UUID_VERSION.tar.gz" \
61+
# install OSSP uuid (http://www.ossp.org/pkg/lib/uuid/)
62+
# see https://github.com/docker-library/postgres/pull/255 for more details
63+
&& wget -O uuid.tar.gz "https://www.mirrorservice.org/sites/ftp.ossp.org/pkg/lib/uuid/uuid-$OSSP_UUID_VERSION.tar.gz" \
6164
&& echo "$OSSP_UUID_SHA256 *uuid.tar.gz" | sha256sum -c - \
6265
&& mkdir -p /usr/src/ossp-uuid \
6366
&& tar \
@@ -66,13 +69,15 @@ RUN set -ex \
6669
--directory /usr/src/ossp-uuid \
6770
--strip-components 1 \
6871
&& rm uuid.tar.gz \
69-
&& cd /usr/src/ossp-uuid \
70-
&& ./configure \
71-
--prefix=/usr \
72-
&& make -j "$(getconf _NPROCESSORS_ONLN)"\
73-
&& make install \
74-
&& cd / \
72+
&& ( \
73+
cd /usr/src/ossp-uuid \
74+
&& ./configure \
75+
--prefix=/usr/local \
76+
&& make -j "$(nproc)" \
77+
&& make install \
78+
) \
7579
&& rm -rf /usr/src/ossp-uuid \
80+
\
7681
&& cd /usr/src/postgresql \
7782
# update "DEFAULT_PGSOCKET_DIR" to "/var/run/postgresql" (matching Debian)
7883
# see https://anonscm.debian.org/git/pkg-postgresql/postgresql.git/tree/debian/patches/51-default-sockets-in-var.patch?id=8b539fcb3e093a521c095e70bdfa76887217b89f
@@ -94,6 +99,8 @@ RUN set -ex \
9499
--with-pgport=5432 \
95100
--with-system-tzdata=/usr/share/zoneinfo \
96101
--prefix=/usr/local \
102+
--with-includes=/usr/local/include \
103+
--with-libraries=/usr/local/lib \
97104
\
98105
# these make our image abnormally large (at least 100MB larger), which seems uncouth for an "Alpine" (ie, "small") variant :)
99106
# --with-krb5 \
@@ -106,7 +113,7 @@ RUN set -ex \
106113
--with-openssl \
107114
--with-libxml \
108115
--with-libxslt \
109-
&& make -j "$(getconf _NPROCESSORS_ONLN)" world \
116+
&& make -j "$(nproc)" world \
110117
&& make install-world \
111118
&& make -C contrib install \
112119
\

9.4/alpine/Dockerfile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ RUN set -ex \
3636
\
3737
&& apk add --no-cache --virtual .build-deps \
3838
bison \
39+
coreutils \
3940
flex \
4041
gcc \
4142
# krb5-dev \
@@ -76,6 +77,8 @@ RUN set -ex \
7677
--with-pgport=5432 \
7778
--with-system-tzdata=/usr/share/zoneinfo \
7879
--prefix=/usr/local \
80+
--with-includes=/usr/local/include \
81+
--with-libraries=/usr/local/lib \
7982
\
8083
# these make our image abnormally large (at least 100MB larger), which seems uncouth for an "Alpine" (ie, "small") variant :)
8184
# --with-krb5 \
@@ -88,7 +91,7 @@ RUN set -ex \
8891
--with-openssl \
8992
--with-libxml \
9093
--with-libxslt \
91-
&& make -j "$(getconf _NPROCESSORS_ONLN)" world \
94+
&& make -j "$(nproc)" world \
9295
&& make install-world \
9396
&& make -C contrib install \
9497
\

9.5/alpine/Dockerfile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ RUN set -ex \
3636
\
3737
&& apk add --no-cache --virtual .build-deps \
3838
bison \
39+
coreutils \
3940
flex \
4041
gcc \
4142
# krb5-dev \
@@ -76,6 +77,8 @@ RUN set -ex \
7677
--with-pgport=5432 \
7778
--with-system-tzdata=/usr/share/zoneinfo \
7879
--prefix=/usr/local \
80+
--with-includes=/usr/local/include \
81+
--with-libraries=/usr/local/lib \
7982
\
8083
# these make our image abnormally large (at least 100MB larger), which seems uncouth for an "Alpine" (ie, "small") variant :)
8184
# --with-krb5 \
@@ -88,7 +91,7 @@ RUN set -ex \
8891
--with-openssl \
8992
--with-libxml \
9093
--with-libxslt \
91-
&& make -j "$(getconf _NPROCESSORS_ONLN)" world \
94+
&& make -j "$(nproc)" world \
9295
&& make install-world \
9396
&& make -C contrib install \
9497
\

9.6/alpine/Dockerfile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ RUN set -ex \
3636
\
3737
&& apk add --no-cache --virtual .build-deps \
3838
bison \
39+
coreutils \
3940
flex \
4041
gcc \
4142
# krb5-dev \
@@ -76,6 +77,8 @@ RUN set -ex \
7677
--with-pgport=5432 \
7778
--with-system-tzdata=/usr/share/zoneinfo \
7879
--prefix=/usr/local \
80+
--with-includes=/usr/local/include \
81+
--with-libraries=/usr/local/lib \
7982
\
8083
# these make our image abnormally large (at least 100MB larger), which seems uncouth for an "Alpine" (ie, "small") variant :)
8184
# --with-krb5 \
@@ -88,7 +91,7 @@ RUN set -ex \
8891
--with-openssl \
8992
--with-libxml \
9093
--with-libxslt \
91-
&& make -j "$(getconf _NPROCESSORS_ONLN)" world \
94+
&& make -j "$(nproc)" world \
9295
&& make install-world \
9396
&& make -C contrib install \
9497
\

Dockerfile-alpine.template

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ RUN set -ex \
3737
\
3838
&& apk add --no-cache --virtual .build-deps \
3939
bison \
40+
coreutils \
4041
flex \
4142
gcc \
4243
# krb5-dev \
@@ -55,7 +56,7 @@ RUN set -ex \
5556
util-linux-dev \
5657
zlib-dev \
5758
\
58-
%%INSTALL_OSSP_UUID%%
59+
%%INSTALL_OSSP_UUID%%
5960
&& cd /usr/src/postgresql \
6061
# update "DEFAULT_PGSOCKET_DIR" to "/var/run/postgresql" (matching Debian)
6162
# see https://anonscm.debian.org/git/pkg-postgresql/postgresql.git/tree/debian/patches/51-default-sockets-in-var.patch?id=8b539fcb3e093a521c095e70bdfa76887217b89f
@@ -78,6 +79,8 @@ RUN set -ex \
7879
--with-pgport=5432 \
7980
--with-system-tzdata=/usr/share/zoneinfo \
8081
--prefix=/usr/local \
82+
--with-includes=/usr/local/include \
83+
--with-libraries=/usr/local/lib \
8184
\
8285
# these make our image abnormally large (at least 100MB larger), which seems uncouth for an "Alpine" (ie, "small") variant :)
8386
# --with-krb5 \
@@ -90,7 +93,7 @@ RUN set -ex \
9093
--with-openssl \
9194
--with-libxml \
9295
--with-libxslt \
93-
&& make -j "$(getconf _NPROCESSORS_ONLN)" world \
96+
&& make -j "$(nproc)" world \
9497
&& make install-world \
9598
&& make -C contrib install \
9699
\

ossp-uuid.template

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
&& wget -O uuid.tar.gz "http://www.mirrorservice.org/sites/ftp.ossp.org/pkg/lib/uuid/uuid-$OSSP_UUID_VERSION.tar.gz" \
1+
# install OSSP uuid (http://www.ossp.org/pkg/lib/uuid/)
2+
# see https://github.com/docker-library/postgres/pull/255 for more details
3+
&& wget -O uuid.tar.gz "https://www.mirrorservice.org/sites/ftp.ossp.org/pkg/lib/uuid/uuid-$OSSP_UUID_VERSION.tar.gz" \
24
&& echo "$OSSP_UUID_SHA256 *uuid.tar.gz" | sha256sum -c - \
35
&& mkdir -p /usr/src/ossp-uuid \
46
&& tar \
@@ -7,10 +9,12 @@
79
--directory /usr/src/ossp-uuid \
810
--strip-components 1 \
911
&& rm uuid.tar.gz \
10-
&& cd /usr/src/ossp-uuid \
11-
&& ./configure \
12-
--prefix=/usr \
13-
&& make -j "$(getconf _NPROCESSORS_ONLN)"\
14-
&& make install \
15-
&& cd / \
12+
&& ( \
13+
cd /usr/src/ossp-uuid \
14+
&& ./configure \
15+
--prefix=/usr/local \
16+
&& make -j "$(nproc)" \
17+
&& make install \
18+
) \
1619
&& rm -rf /usr/src/ossp-uuid \
20+
\

update.sh

Lines changed: 23 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ versions=( "${versions[@]%/}" )
1212
packagesBase='http://apt.postgresql.org/pub/repos/apt/dists/jessie-pgdg'
1313
mainList="$(curl -fsSL "$packagesBase/main/binary-amd64/Packages.bz2" | bunzip2)"
1414

15-
uuidConfigFlag="--with-uuid=e2fs"
15+
# https://www.mirrorservice.org/sites/ftp.ossp.org/pkg/lib/uuid/?C=M;O=D
1616
osspUuidVersion='1.6.2'
1717
osspUuidHash='11a615225baa5f8bb686824423f50e4427acd3f70d394765bdff32801f0fd5b0'
1818

@@ -37,17 +37,29 @@ for version in "${versions[@]}"; do
3737
set -x
3838
cp docker-entrypoint.sh "$version/$variant/"
3939
sed -i 's/gosu/su-exec/g' "$version/$variant/docker-entrypoint.sh"
40-
sed 's/%%PG_MAJOR%%/'"$version"'/g; s/%%PG_VERSION%%/'"$srcVersion"'/g; s/%%PG_SHA256%%/'"$srcSha256"'/g' Dockerfile-$variant.template > "$version/$variant/Dockerfile"
41-
if [[ $version =~ ^9.[23]$ ]]; then
42-
uuidConfigFlag='--with-ossp-uuid'
43-
sed -i 's/%%OSSP_UUID_ENV_VARS%%/ENV OSSP_UUID_VERSION '"$osspUuidVersion"'\nENV OSSP_UUID_SHA256 '"$osspUuidHash"'\n/' "$version/$variant/Dockerfile"
44-
sed -i $'/%%INSTALL_OSSP_UUID%%/ {r ossp-uuid.template\n d}' "$version/$variant/Dockerfile"
45-
sed -i '/--enable-tap-tests/d' "$version/$variant/Dockerfile"
46-
fi
47-
sed -i '/%%OSSP_UUID_ENV_VARS%%/d' "$version/$variant/Dockerfile"
48-
sed -i '/%%INSTALL_OSSP_UUID%%/d' "$version/$variant/Dockerfile"
49-
sed -i 's/%%UUID_CONFIG_FLAG%%/'"$uuidConfigFlag"'/' "$version/$variant/Dockerfile"
40+
sed -e 's/%%PG_MAJOR%%/'"$version"'/g' \
41+
-e 's/%%PG_VERSION%%/'"$srcVersion"'/g' \
42+
-e 's/%%PG_SHA256%%/'"$srcSha256"'/g' \
43+
"Dockerfile-$variant.template" > "$version/$variant/Dockerfile"
44+
45+
# TODO remove all this when 9.2 and 9.3 are EOL (2017-10-01 and 2018-10-01 -- from http://www.postgresql.org/support/versioning/)
46+
case "$version" in
47+
9.2|9.3)
48+
uuidConfigFlag='--with-ossp-uuid'
49+
sed -i 's/%%OSSP_UUID_ENV_VARS%%/ENV OSSP_UUID_VERSION '"$osspUuidVersion"'\nENV OSSP_UUID_SHA256 '"$osspUuidHash"'\n/' "$version/$variant/Dockerfile"
50+
sed -i $'/%%INSTALL_OSSP_UUID%%/ {r ossp-uuid.template\n d}' "$version/$variant/Dockerfile"
5051

52+
# configure: WARNING: unrecognized options: --enable-tap-tests
53+
sed -i '/--enable-tap-tests/d' "$version/$variant/Dockerfile"
54+
;;
55+
56+
*)
57+
uuidConfigFlag='--with-uuid=e2fs'
58+
sed -i '/%%OSSP_UUID_ENV_VARS%%/d' "$version/$variant/Dockerfile"
59+
sed -i '/%%INSTALL_OSSP_UUID%%/d' "$version/$variant/Dockerfile"
60+
;;
61+
esac
62+
sed -i 's/%%UUID_CONFIG_FLAG%%/'"$uuidConfigFlag"'/' "$version/$variant/Dockerfile"
5163
)
5264
travisEnv="\n - VERSION=$version VARIANT=$variant$travisEnv"
5365
done

0 commit comments

Comments
 (0)
0