You've already forked postgres
mirror of
https://github.com/docker-library/postgres.git
synced 2025-11-17 13:02:40 +03:00
Merge pull request #750 from infosiftr/ampersand
Replace "&&" chains with ";" in Alpine variants
This commit is contained in:
@@ -21,19 +21,20 @@ ENV PG_MAJOR 10
|
|||||||
ENV PG_VERSION 10.13
|
ENV PG_VERSION 10.13
|
||||||
ENV PG_SHA256 4d701f450cd92ffb123cf6c296e9656abbc2ab7ea6507894ff1e2475ae0754e1
|
ENV PG_SHA256 4d701f450cd92ffb123cf6c296e9656abbc2ab7ea6507894ff1e2475ae0754e1
|
||||||
|
|
||||||
RUN set -ex \
|
RUN set -eux; \
|
||||||
\
|
\
|
||||||
&& wget -O postgresql.tar.bz2 "https://ftp.postgresql.org/pub/source/v$PG_VERSION/postgresql-$PG_VERSION.tar.bz2" \
|
wget -O postgresql.tar.bz2 "https://ftp.postgresql.org/pub/source/v$PG_VERSION/postgresql-$PG_VERSION.tar.bz2"; \
|
||||||
&& echo "$PG_SHA256 *postgresql.tar.bz2" | sha256sum -c - \
|
echo "$PG_SHA256 *postgresql.tar.bz2" | sha256sum -c -; \
|
||||||
&& mkdir -p /usr/src/postgresql \
|
mkdir -p /usr/src/postgresql; \
|
||||||
&& tar \
|
tar \
|
||||||
--extract \
|
--extract \
|
||||||
--file postgresql.tar.bz2 \
|
--file postgresql.tar.bz2 \
|
||||||
--directory /usr/src/postgresql \
|
--directory /usr/src/postgresql \
|
||||||
--strip-components 1 \
|
--strip-components 1 \
|
||||||
&& rm postgresql.tar.bz2 \
|
; \
|
||||||
|
rm postgresql.tar.bz2; \
|
||||||
\
|
\
|
||||||
&& apk add --no-cache --virtual .build-deps \
|
apk add --no-cache --virtual .build-deps \
|
||||||
bison \
|
bison \
|
||||||
coreutils \
|
coreutils \
|
||||||
dpkg-dev dpkg \
|
dpkg-dev dpkg \
|
||||||
@@ -59,20 +60,21 @@ RUN set -ex \
|
|||||||
util-linux-dev \
|
util-linux-dev \
|
||||||
zlib-dev \
|
zlib-dev \
|
||||||
icu-dev \
|
icu-dev \
|
||||||
|
; \
|
||||||
\
|
\
|
||||||
&& cd /usr/src/postgresql \
|
cd /usr/src/postgresql; \
|
||||||
# update "DEFAULT_PGSOCKET_DIR" to "/var/run/postgresql" (matching Debian)
|
# update "DEFAULT_PGSOCKET_DIR" to "/var/run/postgresql" (matching Debian)
|
||||||
# see https://anonscm.debian.org/git/pkg-postgresql/postgresql.git/tree/debian/patches/51-default-sockets-in-var.patch?id=8b539fcb3e093a521c095e70bdfa76887217b89f
|
# see https://anonscm.debian.org/git/pkg-postgresql/postgresql.git/tree/debian/patches/51-default-sockets-in-var.patch?id=8b539fcb3e093a521c095e70bdfa76887217b89f
|
||||||
&& awk '$1 == "#define" && $2 == "DEFAULT_PGSOCKET_DIR" && $3 == "\"/tmp\"" { $3 = "\"/var/run/postgresql\""; print; next } { print }' src/include/pg_config_manual.h > src/include/pg_config_manual.h.new \
|
awk '$1 == "#define" && $2 == "DEFAULT_PGSOCKET_DIR" && $3 == "\"/tmp\"" { $3 = "\"/var/run/postgresql\""; print; next } { print }' src/include/pg_config_manual.h > src/include/pg_config_manual.h.new; \
|
||||||
&& grep '/var/run/postgresql' src/include/pg_config_manual.h.new \
|
grep '/var/run/postgresql' src/include/pg_config_manual.h.new; \
|
||||||
&& mv src/include/pg_config_manual.h.new src/include/pg_config_manual.h \
|
mv src/include/pg_config_manual.h.new src/include/pg_config_manual.h; \
|
||||||
&& gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)" \
|
gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)"; \
|
||||||
# explicitly update autoconf config.guess and config.sub so they support more arches/libcs
|
# explicitly update autoconf config.guess and config.sub so they support more arches/libcs
|
||||||
&& wget -O config/config.guess 'https://git.savannah.gnu.org/cgit/config.git/plain/config.guess?id=7d3d27baf8107b630586c962c057e22149653deb' \
|
wget -O config/config.guess 'https://git.savannah.gnu.org/cgit/config.git/plain/config.guess?id=7d3d27baf8107b630586c962c057e22149653deb'; \
|
||||||
&& wget -O config/config.sub 'https://git.savannah.gnu.org/cgit/config.git/plain/config.sub?id=7d3d27baf8107b630586c962c057e22149653deb' \
|
wget -O config/config.sub 'https://git.savannah.gnu.org/cgit/config.git/plain/config.sub?id=7d3d27baf8107b630586c962c057e22149653deb'; \
|
||||||
# configure options taken from:
|
# configure options taken from:
|
||||||
# https://anonscm.debian.org/cgit/pkg-postgresql/postgresql.git/tree/debian/rules?h=9.5
|
# https://anonscm.debian.org/cgit/pkg-postgresql/postgresql.git/tree/debian/rules?h=9.5
|
||||||
&& ./configure \
|
./configure \
|
||||||
--build="$gnuArch" \
|
--build="$gnuArch" \
|
||||||
# "/usr/src/postgresql/src/backend/access/common/tupconvert.c:105: undefined reference to `libintl_gettext'"
|
# "/usr/src/postgresql/src/backend/access/common/tupconvert.c:105: undefined reference to `libintl_gettext'"
|
||||||
# --enable-nls \
|
# --enable-nls \
|
||||||
@@ -102,30 +104,35 @@ RUN set -ex \
|
|||||||
--with-libxml \
|
--with-libxml \
|
||||||
--with-libxslt \
|
--with-libxslt \
|
||||||
--with-icu \
|
--with-icu \
|
||||||
&& make -j "$(nproc)" world \
|
; \
|
||||||
&& make install-world \
|
make -j "$(nproc)" world; \
|
||||||
&& make -C contrib install \
|
make install-world; \
|
||||||
|
make -C contrib install; \
|
||||||
\
|
\
|
||||||
&& runDeps="$( \
|
runDeps="$( \
|
||||||
scanelf --needed --nobanner --format '%n#p' --recursive /usr/local \
|
scanelf --needed --nobanner --format '%n#p' --recursive /usr/local \
|
||||||
| tr ',' '\n' \
|
| tr ',' '\n' \
|
||||||
| sort -u \
|
| sort -u \
|
||||||
| awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \
|
| awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \
|
||||||
)" \
|
)"; \
|
||||||
&& apk add --no-cache --virtual .postgresql-rundeps \
|
apk add --no-cache --virtual .postgresql-rundeps \
|
||||||
$runDeps \
|
$runDeps \
|
||||||
bash \
|
bash \
|
||||||
su-exec \
|
su-exec \
|
||||||
# tzdata is optional, but only adds around 1Mb to image size and is recommended by Django documentation:
|
# tzdata is optional, but only adds around 1Mb to image size and is recommended by Django documentation:
|
||||||
# https://docs.djangoproject.com/en/1.10/ref/databases/#optimizing-postgresql-s-configuration
|
# https://docs.djangoproject.com/en/1.10/ref/databases/#optimizing-postgresql-s-configuration
|
||||||
tzdata \
|
tzdata \
|
||||||
&& apk del --no-network .build-deps \
|
; \
|
||||||
&& cd / \
|
apk del --no-network .build-deps; \
|
||||||
&& rm -rf \
|
cd /; \
|
||||||
|
rm -rf \
|
||||||
/usr/src/postgresql \
|
/usr/src/postgresql \
|
||||||
/usr/local/share/doc \
|
/usr/local/share/doc \
|
||||||
/usr/local/share/man \
|
/usr/local/share/man \
|
||||||
&& find /usr/local -name '*.a' -delete
|
; \
|
||||||
|
find /usr/local -name '*.a' -delete; \
|
||||||
|
\
|
||||||
|
postgres --version
|
||||||
|
|
||||||
# make the sample config easier to munge (and "correct by default")
|
# make the sample config easier to munge (and "correct by default")
|
||||||
RUN sed -ri "s!^#?(listen_addresses)\s*=\s*\S+.*!\1 = '*'!" /usr/local/share/postgresql/postgresql.conf.sample
|
RUN sed -ri "s!^#?(listen_addresses)\s*=\s*\S+.*!\1 = '*'!" /usr/local/share/postgresql/postgresql.conf.sample
|
||||||
|
|||||||
@@ -21,19 +21,20 @@ ENV PG_MAJOR 11
|
|||||||
ENV PG_VERSION 11.8
|
ENV PG_VERSION 11.8
|
||||||
ENV PG_SHA256 eaf2f4329ccc349c89e950761b81daf8c99bb8966abcab5665ccd6ee95c77ae2
|
ENV PG_SHA256 eaf2f4329ccc349c89e950761b81daf8c99bb8966abcab5665ccd6ee95c77ae2
|
||||||
|
|
||||||
RUN set -ex \
|
RUN set -eux; \
|
||||||
\
|
\
|
||||||
&& wget -O postgresql.tar.bz2 "https://ftp.postgresql.org/pub/source/v$PG_VERSION/postgresql-$PG_VERSION.tar.bz2" \
|
wget -O postgresql.tar.bz2 "https://ftp.postgresql.org/pub/source/v$PG_VERSION/postgresql-$PG_VERSION.tar.bz2"; \
|
||||||
&& echo "$PG_SHA256 *postgresql.tar.bz2" | sha256sum -c - \
|
echo "$PG_SHA256 *postgresql.tar.bz2" | sha256sum -c -; \
|
||||||
&& mkdir -p /usr/src/postgresql \
|
mkdir -p /usr/src/postgresql; \
|
||||||
&& tar \
|
tar \
|
||||||
--extract \
|
--extract \
|
||||||
--file postgresql.tar.bz2 \
|
--file postgresql.tar.bz2 \
|
||||||
--directory /usr/src/postgresql \
|
--directory /usr/src/postgresql \
|
||||||
--strip-components 1 \
|
--strip-components 1 \
|
||||||
&& rm postgresql.tar.bz2 \
|
; \
|
||||||
|
rm postgresql.tar.bz2; \
|
||||||
\
|
\
|
||||||
&& apk add --no-cache --virtual .build-deps \
|
apk add --no-cache --virtual .build-deps \
|
||||||
bison \
|
bison \
|
||||||
coreutils \
|
coreutils \
|
||||||
dpkg-dev dpkg \
|
dpkg-dev dpkg \
|
||||||
@@ -60,20 +61,21 @@ RUN set -ex \
|
|||||||
util-linux-dev \
|
util-linux-dev \
|
||||||
zlib-dev \
|
zlib-dev \
|
||||||
icu-dev \
|
icu-dev \
|
||||||
|
; \
|
||||||
\
|
\
|
||||||
&& cd /usr/src/postgresql \
|
cd /usr/src/postgresql; \
|
||||||
# update "DEFAULT_PGSOCKET_DIR" to "/var/run/postgresql" (matching Debian)
|
# update "DEFAULT_PGSOCKET_DIR" to "/var/run/postgresql" (matching Debian)
|
||||||
# see https://anonscm.debian.org/git/pkg-postgresql/postgresql.git/tree/debian/patches/51-default-sockets-in-var.patch?id=8b539fcb3e093a521c095e70bdfa76887217b89f
|
# see https://anonscm.debian.org/git/pkg-postgresql/postgresql.git/tree/debian/patches/51-default-sockets-in-var.patch?id=8b539fcb3e093a521c095e70bdfa76887217b89f
|
||||||
&& awk '$1 == "#define" && $2 == "DEFAULT_PGSOCKET_DIR" && $3 == "\"/tmp\"" { $3 = "\"/var/run/postgresql\""; print; next } { print }' src/include/pg_config_manual.h > src/include/pg_config_manual.h.new \
|
awk '$1 == "#define" && $2 == "DEFAULT_PGSOCKET_DIR" && $3 == "\"/tmp\"" { $3 = "\"/var/run/postgresql\""; print; next } { print }' src/include/pg_config_manual.h > src/include/pg_config_manual.h.new; \
|
||||||
&& grep '/var/run/postgresql' src/include/pg_config_manual.h.new \
|
grep '/var/run/postgresql' src/include/pg_config_manual.h.new; \
|
||||||
&& mv src/include/pg_config_manual.h.new src/include/pg_config_manual.h \
|
mv src/include/pg_config_manual.h.new src/include/pg_config_manual.h; \
|
||||||
&& gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)" \
|
gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)"; \
|
||||||
# explicitly update autoconf config.guess and config.sub so they support more arches/libcs
|
# explicitly update autoconf config.guess and config.sub so they support more arches/libcs
|
||||||
&& wget -O config/config.guess 'https://git.savannah.gnu.org/cgit/config.git/plain/config.guess?id=7d3d27baf8107b630586c962c057e22149653deb' \
|
wget -O config/config.guess 'https://git.savannah.gnu.org/cgit/config.git/plain/config.guess?id=7d3d27baf8107b630586c962c057e22149653deb'; \
|
||||||
&& wget -O config/config.sub 'https://git.savannah.gnu.org/cgit/config.git/plain/config.sub?id=7d3d27baf8107b630586c962c057e22149653deb' \
|
wget -O config/config.sub 'https://git.savannah.gnu.org/cgit/config.git/plain/config.sub?id=7d3d27baf8107b630586c962c057e22149653deb'; \
|
||||||
# configure options taken from:
|
# configure options taken from:
|
||||||
# https://anonscm.debian.org/cgit/pkg-postgresql/postgresql.git/tree/debian/rules?h=9.5
|
# https://anonscm.debian.org/cgit/pkg-postgresql/postgresql.git/tree/debian/rules?h=9.5
|
||||||
&& ./configure \
|
./configure \
|
||||||
--build="$gnuArch" \
|
--build="$gnuArch" \
|
||||||
# "/usr/src/postgresql/src/backend/access/common/tupconvert.c:105: undefined reference to `libintl_gettext'"
|
# "/usr/src/postgresql/src/backend/access/common/tupconvert.c:105: undefined reference to `libintl_gettext'"
|
||||||
# --enable-nls \
|
# --enable-nls \
|
||||||
@@ -104,30 +106,35 @@ RUN set -ex \
|
|||||||
--with-libxslt \
|
--with-libxslt \
|
||||||
--with-icu \
|
--with-icu \
|
||||||
--with-llvm \
|
--with-llvm \
|
||||||
&& make -j "$(nproc)" world \
|
; \
|
||||||
&& make install-world \
|
make -j "$(nproc)" world; \
|
||||||
&& make -C contrib install \
|
make install-world; \
|
||||||
|
make -C contrib install; \
|
||||||
\
|
\
|
||||||
&& runDeps="$( \
|
runDeps="$( \
|
||||||
scanelf --needed --nobanner --format '%n#p' --recursive /usr/local \
|
scanelf --needed --nobanner --format '%n#p' --recursive /usr/local \
|
||||||
| tr ',' '\n' \
|
| tr ',' '\n' \
|
||||||
| sort -u \
|
| sort -u \
|
||||||
| awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \
|
| awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \
|
||||||
)" \
|
)"; \
|
||||||
&& apk add --no-cache --virtual .postgresql-rundeps \
|
apk add --no-cache --virtual .postgresql-rundeps \
|
||||||
$runDeps \
|
$runDeps \
|
||||||
bash \
|
bash \
|
||||||
su-exec \
|
su-exec \
|
||||||
# tzdata is optional, but only adds around 1Mb to image size and is recommended by Django documentation:
|
# tzdata is optional, but only adds around 1Mb to image size and is recommended by Django documentation:
|
||||||
# https://docs.djangoproject.com/en/1.10/ref/databases/#optimizing-postgresql-s-configuration
|
# https://docs.djangoproject.com/en/1.10/ref/databases/#optimizing-postgresql-s-configuration
|
||||||
tzdata \
|
tzdata \
|
||||||
&& apk del --no-network .build-deps \
|
; \
|
||||||
&& cd / \
|
apk del --no-network .build-deps; \
|
||||||
&& rm -rf \
|
cd /; \
|
||||||
|
rm -rf \
|
||||||
/usr/src/postgresql \
|
/usr/src/postgresql \
|
||||||
/usr/local/share/doc \
|
/usr/local/share/doc \
|
||||||
/usr/local/share/man \
|
/usr/local/share/man \
|
||||||
&& find /usr/local -name '*.a' -delete
|
; \
|
||||||
|
find /usr/local -name '*.a' -delete; \
|
||||||
|
\
|
||||||
|
postgres --version
|
||||||
|
|
||||||
# make the sample config easier to munge (and "correct by default")
|
# make the sample config easier to munge (and "correct by default")
|
||||||
RUN sed -ri "s!^#?(listen_addresses)\s*=\s*\S+.*!\1 = '*'!" /usr/local/share/postgresql/postgresql.conf.sample
|
RUN sed -ri "s!^#?(listen_addresses)\s*=\s*\S+.*!\1 = '*'!" /usr/local/share/postgresql/postgresql.conf.sample
|
||||||
|
|||||||
@@ -21,19 +21,20 @@ ENV PG_MAJOR 12
|
|||||||
ENV PG_VERSION 12.3
|
ENV PG_VERSION 12.3
|
||||||
ENV PG_SHA256 94ed64a6179048190695c86ec707cc25d016056ce10fc9d229267d9a8f1dcf41
|
ENV PG_SHA256 94ed64a6179048190695c86ec707cc25d016056ce10fc9d229267d9a8f1dcf41
|
||||||
|
|
||||||
RUN set -ex \
|
RUN set -eux; \
|
||||||
\
|
\
|
||||||
&& wget -O postgresql.tar.bz2 "https://ftp.postgresql.org/pub/source/v$PG_VERSION/postgresql-$PG_VERSION.tar.bz2" \
|
wget -O postgresql.tar.bz2 "https://ftp.postgresql.org/pub/source/v$PG_VERSION/postgresql-$PG_VERSION.tar.bz2"; \
|
||||||
&& echo "$PG_SHA256 *postgresql.tar.bz2" | sha256sum -c - \
|
echo "$PG_SHA256 *postgresql.tar.bz2" | sha256sum -c -; \
|
||||||
&& mkdir -p /usr/src/postgresql \
|
mkdir -p /usr/src/postgresql; \
|
||||||
&& tar \
|
tar \
|
||||||
--extract \
|
--extract \
|
||||||
--file postgresql.tar.bz2 \
|
--file postgresql.tar.bz2 \
|
||||||
--directory /usr/src/postgresql \
|
--directory /usr/src/postgresql \
|
||||||
--strip-components 1 \
|
--strip-components 1 \
|
||||||
&& rm postgresql.tar.bz2 \
|
; \
|
||||||
|
rm postgresql.tar.bz2; \
|
||||||
\
|
\
|
||||||
&& apk add --no-cache --virtual .build-deps \
|
apk add --no-cache --virtual .build-deps \
|
||||||
bison \
|
bison \
|
||||||
coreutils \
|
coreutils \
|
||||||
dpkg-dev dpkg \
|
dpkg-dev dpkg \
|
||||||
@@ -60,20 +61,21 @@ RUN set -ex \
|
|||||||
util-linux-dev \
|
util-linux-dev \
|
||||||
zlib-dev \
|
zlib-dev \
|
||||||
icu-dev \
|
icu-dev \
|
||||||
|
; \
|
||||||
\
|
\
|
||||||
&& cd /usr/src/postgresql \
|
cd /usr/src/postgresql; \
|
||||||
# update "DEFAULT_PGSOCKET_DIR" to "/var/run/postgresql" (matching Debian)
|
# update "DEFAULT_PGSOCKET_DIR" to "/var/run/postgresql" (matching Debian)
|
||||||
# see https://anonscm.debian.org/git/pkg-postgresql/postgresql.git/tree/debian/patches/51-default-sockets-in-var.patch?id=8b539fcb3e093a521c095e70bdfa76887217b89f
|
# see https://anonscm.debian.org/git/pkg-postgresql/postgresql.git/tree/debian/patches/51-default-sockets-in-var.patch?id=8b539fcb3e093a521c095e70bdfa76887217b89f
|
||||||
&& awk '$1 == "#define" && $2 == "DEFAULT_PGSOCKET_DIR" && $3 == "\"/tmp\"" { $3 = "\"/var/run/postgresql\""; print; next } { print }' src/include/pg_config_manual.h > src/include/pg_config_manual.h.new \
|
awk '$1 == "#define" && $2 == "DEFAULT_PGSOCKET_DIR" && $3 == "\"/tmp\"" { $3 = "\"/var/run/postgresql\""; print; next } { print }' src/include/pg_config_manual.h > src/include/pg_config_manual.h.new; \
|
||||||
&& grep '/var/run/postgresql' src/include/pg_config_manual.h.new \
|
grep '/var/run/postgresql' src/include/pg_config_manual.h.new; \
|
||||||
&& mv src/include/pg_config_manual.h.new src/include/pg_config_manual.h \
|
mv src/include/pg_config_manual.h.new src/include/pg_config_manual.h; \
|
||||||
&& gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)" \
|
gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)"; \
|
||||||
# explicitly update autoconf config.guess and config.sub so they support more arches/libcs
|
# explicitly update autoconf config.guess and config.sub so they support more arches/libcs
|
||||||
&& wget -O config/config.guess 'https://git.savannah.gnu.org/cgit/config.git/plain/config.guess?id=7d3d27baf8107b630586c962c057e22149653deb' \
|
wget -O config/config.guess 'https://git.savannah.gnu.org/cgit/config.git/plain/config.guess?id=7d3d27baf8107b630586c962c057e22149653deb'; \
|
||||||
&& wget -O config/config.sub 'https://git.savannah.gnu.org/cgit/config.git/plain/config.sub?id=7d3d27baf8107b630586c962c057e22149653deb' \
|
wget -O config/config.sub 'https://git.savannah.gnu.org/cgit/config.git/plain/config.sub?id=7d3d27baf8107b630586c962c057e22149653deb'; \
|
||||||
# configure options taken from:
|
# configure options taken from:
|
||||||
# https://anonscm.debian.org/cgit/pkg-postgresql/postgresql.git/tree/debian/rules?h=9.5
|
# https://anonscm.debian.org/cgit/pkg-postgresql/postgresql.git/tree/debian/rules?h=9.5
|
||||||
&& ./configure \
|
./configure \
|
||||||
--build="$gnuArch" \
|
--build="$gnuArch" \
|
||||||
# "/usr/src/postgresql/src/backend/access/common/tupconvert.c:105: undefined reference to `libintl_gettext'"
|
# "/usr/src/postgresql/src/backend/access/common/tupconvert.c:105: undefined reference to `libintl_gettext'"
|
||||||
# --enable-nls \
|
# --enable-nls \
|
||||||
@@ -104,30 +106,35 @@ RUN set -ex \
|
|||||||
--with-libxslt \
|
--with-libxslt \
|
||||||
--with-icu \
|
--with-icu \
|
||||||
--with-llvm \
|
--with-llvm \
|
||||||
&& make -j "$(nproc)" world \
|
; \
|
||||||
&& make install-world \
|
make -j "$(nproc)" world; \
|
||||||
&& make -C contrib install \
|
make install-world; \
|
||||||
|
make -C contrib install; \
|
||||||
\
|
\
|
||||||
&& runDeps="$( \
|
runDeps="$( \
|
||||||
scanelf --needed --nobanner --format '%n#p' --recursive /usr/local \
|
scanelf --needed --nobanner --format '%n#p' --recursive /usr/local \
|
||||||
| tr ',' '\n' \
|
| tr ',' '\n' \
|
||||||
| sort -u \
|
| sort -u \
|
||||||
| awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \
|
| awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \
|
||||||
)" \
|
)"; \
|
||||||
&& apk add --no-cache --virtual .postgresql-rundeps \
|
apk add --no-cache --virtual .postgresql-rundeps \
|
||||||
$runDeps \
|
$runDeps \
|
||||||
bash \
|
bash \
|
||||||
su-exec \
|
su-exec \
|
||||||
# tzdata is optional, but only adds around 1Mb to image size and is recommended by Django documentation:
|
# tzdata is optional, but only adds around 1Mb to image size and is recommended by Django documentation:
|
||||||
# https://docs.djangoproject.com/en/1.10/ref/databases/#optimizing-postgresql-s-configuration
|
# https://docs.djangoproject.com/en/1.10/ref/databases/#optimizing-postgresql-s-configuration
|
||||||
tzdata \
|
tzdata \
|
||||||
&& apk del --no-network .build-deps \
|
; \
|
||||||
&& cd / \
|
apk del --no-network .build-deps; \
|
||||||
&& rm -rf \
|
cd /; \
|
||||||
|
rm -rf \
|
||||||
/usr/src/postgresql \
|
/usr/src/postgresql \
|
||||||
/usr/local/share/doc \
|
/usr/local/share/doc \
|
||||||
/usr/local/share/man \
|
/usr/local/share/man \
|
||||||
&& find /usr/local -name '*.a' -delete
|
; \
|
||||||
|
find /usr/local -name '*.a' -delete; \
|
||||||
|
\
|
||||||
|
postgres --version
|
||||||
|
|
||||||
# make the sample config easier to munge (and "correct by default")
|
# make the sample config easier to munge (and "correct by default")
|
||||||
RUN sed -ri "s!^#?(listen_addresses)\s*=\s*\S+.*!\1 = '*'!" /usr/local/share/postgresql/postgresql.conf.sample
|
RUN sed -ri "s!^#?(listen_addresses)\s*=\s*\S+.*!\1 = '*'!" /usr/local/share/postgresql/postgresql.conf.sample
|
||||||
|
|||||||
@@ -21,19 +21,20 @@ ENV PG_MAJOR 13
|
|||||||
ENV PG_VERSION 13beta2
|
ENV PG_VERSION 13beta2
|
||||||
ENV PG_SHA256 51b8c64f4c354728555144a7bfbdced96afb86e5cfa80a26b5e96a1d9081ee9f
|
ENV PG_SHA256 51b8c64f4c354728555144a7bfbdced96afb86e5cfa80a26b5e96a1d9081ee9f
|
||||||
|
|
||||||
RUN set -ex \
|
RUN set -eux; \
|
||||||
\
|
\
|
||||||
&& wget -O postgresql.tar.bz2 "https://ftp.postgresql.org/pub/source/v$PG_VERSION/postgresql-$PG_VERSION.tar.bz2" \
|
wget -O postgresql.tar.bz2 "https://ftp.postgresql.org/pub/source/v$PG_VERSION/postgresql-$PG_VERSION.tar.bz2"; \
|
||||||
&& echo "$PG_SHA256 *postgresql.tar.bz2" | sha256sum -c - \
|
echo "$PG_SHA256 *postgresql.tar.bz2" | sha256sum -c -; \
|
||||||
&& mkdir -p /usr/src/postgresql \
|
mkdir -p /usr/src/postgresql; \
|
||||||
&& tar \
|
tar \
|
||||||
--extract \
|
--extract \
|
||||||
--file postgresql.tar.bz2 \
|
--file postgresql.tar.bz2 \
|
||||||
--directory /usr/src/postgresql \
|
--directory /usr/src/postgresql \
|
||||||
--strip-components 1 \
|
--strip-components 1 \
|
||||||
&& rm postgresql.tar.bz2 \
|
; \
|
||||||
|
rm postgresql.tar.bz2; \
|
||||||
\
|
\
|
||||||
&& apk add --no-cache --virtual .build-deps \
|
apk add --no-cache --virtual .build-deps \
|
||||||
bison \
|
bison \
|
||||||
coreutils \
|
coreutils \
|
||||||
dpkg-dev dpkg \
|
dpkg-dev dpkg \
|
||||||
@@ -60,20 +61,21 @@ RUN set -ex \
|
|||||||
util-linux-dev \
|
util-linux-dev \
|
||||||
zlib-dev \
|
zlib-dev \
|
||||||
icu-dev \
|
icu-dev \
|
||||||
|
; \
|
||||||
\
|
\
|
||||||
&& cd /usr/src/postgresql \
|
cd /usr/src/postgresql; \
|
||||||
# update "DEFAULT_PGSOCKET_DIR" to "/var/run/postgresql" (matching Debian)
|
# update "DEFAULT_PGSOCKET_DIR" to "/var/run/postgresql" (matching Debian)
|
||||||
# see https://anonscm.debian.org/git/pkg-postgresql/postgresql.git/tree/debian/patches/51-default-sockets-in-var.patch?id=8b539fcb3e093a521c095e70bdfa76887217b89f
|
# see https://anonscm.debian.org/git/pkg-postgresql/postgresql.git/tree/debian/patches/51-default-sockets-in-var.patch?id=8b539fcb3e093a521c095e70bdfa76887217b89f
|
||||||
&& awk '$1 == "#define" && $2 == "DEFAULT_PGSOCKET_DIR" && $3 == "\"/tmp\"" { $3 = "\"/var/run/postgresql\""; print; next } { print }' src/include/pg_config_manual.h > src/include/pg_config_manual.h.new \
|
awk '$1 == "#define" && $2 == "DEFAULT_PGSOCKET_DIR" && $3 == "\"/tmp\"" { $3 = "\"/var/run/postgresql\""; print; next } { print }' src/include/pg_config_manual.h > src/include/pg_config_manual.h.new; \
|
||||||
&& grep '/var/run/postgresql' src/include/pg_config_manual.h.new \
|
grep '/var/run/postgresql' src/include/pg_config_manual.h.new; \
|
||||||
&& mv src/include/pg_config_manual.h.new src/include/pg_config_manual.h \
|
mv src/include/pg_config_manual.h.new src/include/pg_config_manual.h; \
|
||||||
&& gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)" \
|
gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)"; \
|
||||||
# explicitly update autoconf config.guess and config.sub so they support more arches/libcs
|
# explicitly update autoconf config.guess and config.sub so they support more arches/libcs
|
||||||
&& wget -O config/config.guess 'https://git.savannah.gnu.org/cgit/config.git/plain/config.guess?id=7d3d27baf8107b630586c962c057e22149653deb' \
|
wget -O config/config.guess 'https://git.savannah.gnu.org/cgit/config.git/plain/config.guess?id=7d3d27baf8107b630586c962c057e22149653deb'; \
|
||||||
&& wget -O config/config.sub 'https://git.savannah.gnu.org/cgit/config.git/plain/config.sub?id=7d3d27baf8107b630586c962c057e22149653deb' \
|
wget -O config/config.sub 'https://git.savannah.gnu.org/cgit/config.git/plain/config.sub?id=7d3d27baf8107b630586c962c057e22149653deb'; \
|
||||||
# configure options taken from:
|
# configure options taken from:
|
||||||
# https://anonscm.debian.org/cgit/pkg-postgresql/postgresql.git/tree/debian/rules?h=9.5
|
# https://anonscm.debian.org/cgit/pkg-postgresql/postgresql.git/tree/debian/rules?h=9.5
|
||||||
&& ./configure \
|
./configure \
|
||||||
--build="$gnuArch" \
|
--build="$gnuArch" \
|
||||||
# "/usr/src/postgresql/src/backend/access/common/tupconvert.c:105: undefined reference to `libintl_gettext'"
|
# "/usr/src/postgresql/src/backend/access/common/tupconvert.c:105: undefined reference to `libintl_gettext'"
|
||||||
# --enable-nls \
|
# --enable-nls \
|
||||||
@@ -104,30 +106,35 @@ RUN set -ex \
|
|||||||
--with-libxslt \
|
--with-libxslt \
|
||||||
--with-icu \
|
--with-icu \
|
||||||
--with-llvm \
|
--with-llvm \
|
||||||
&& make -j "$(nproc)" world \
|
; \
|
||||||
&& make install-world \
|
make -j "$(nproc)" world; \
|
||||||
&& make -C contrib install \
|
make install-world; \
|
||||||
|
make -C contrib install; \
|
||||||
\
|
\
|
||||||
&& runDeps="$( \
|
runDeps="$( \
|
||||||
scanelf --needed --nobanner --format '%n#p' --recursive /usr/local \
|
scanelf --needed --nobanner --format '%n#p' --recursive /usr/local \
|
||||||
| tr ',' '\n' \
|
| tr ',' '\n' \
|
||||||
| sort -u \
|
| sort -u \
|
||||||
| awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \
|
| awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \
|
||||||
)" \
|
)"; \
|
||||||
&& apk add --no-cache --virtual .postgresql-rundeps \
|
apk add --no-cache --virtual .postgresql-rundeps \
|
||||||
$runDeps \
|
$runDeps \
|
||||||
bash \
|
bash \
|
||||||
su-exec \
|
su-exec \
|
||||||
# tzdata is optional, but only adds around 1Mb to image size and is recommended by Django documentation:
|
# tzdata is optional, but only adds around 1Mb to image size and is recommended by Django documentation:
|
||||||
# https://docs.djangoproject.com/en/1.10/ref/databases/#optimizing-postgresql-s-configuration
|
# https://docs.djangoproject.com/en/1.10/ref/databases/#optimizing-postgresql-s-configuration
|
||||||
tzdata \
|
tzdata \
|
||||||
&& apk del --no-network .build-deps \
|
; \
|
||||||
&& cd / \
|
apk del --no-network .build-deps; \
|
||||||
&& rm -rf \
|
cd /; \
|
||||||
|
rm -rf \
|
||||||
/usr/src/postgresql \
|
/usr/src/postgresql \
|
||||||
/usr/local/share/doc \
|
/usr/local/share/doc \
|
||||||
/usr/local/share/man \
|
/usr/local/share/man \
|
||||||
&& find /usr/local -name '*.a' -delete
|
; \
|
||||||
|
find /usr/local -name '*.a' -delete; \
|
||||||
|
\
|
||||||
|
postgres --version
|
||||||
|
|
||||||
# make the sample config easier to munge (and "correct by default")
|
# make the sample config easier to munge (and "correct by default")
|
||||||
RUN sed -ri "s!^#?(listen_addresses)\s*=\s*\S+.*!\1 = '*'!" /usr/local/share/postgresql/postgresql.conf.sample
|
RUN sed -ri "s!^#?(listen_addresses)\s*=\s*\S+.*!\1 = '*'!" /usr/local/share/postgresql/postgresql.conf.sample
|
||||||
|
|||||||
@@ -21,19 +21,20 @@ ENV PG_MAJOR 9.5
|
|||||||
ENV PG_VERSION 9.5.22
|
ENV PG_VERSION 9.5.22
|
||||||
ENV PG_SHA256 48555470a17248cb204d25ab1ad4231ef16295db55161922f006b9942d69640f
|
ENV PG_SHA256 48555470a17248cb204d25ab1ad4231ef16295db55161922f006b9942d69640f
|
||||||
|
|
||||||
RUN set -ex \
|
RUN set -eux; \
|
||||||
\
|
\
|
||||||
&& wget -O postgresql.tar.bz2 "https://ftp.postgresql.org/pub/source/v$PG_VERSION/postgresql-$PG_VERSION.tar.bz2" \
|
wget -O postgresql.tar.bz2 "https://ftp.postgresql.org/pub/source/v$PG_VERSION/postgresql-$PG_VERSION.tar.bz2"; \
|
||||||
&& echo "$PG_SHA256 *postgresql.tar.bz2" | sha256sum -c - \
|
echo "$PG_SHA256 *postgresql.tar.bz2" | sha256sum -c -; \
|
||||||
&& mkdir -p /usr/src/postgresql \
|
mkdir -p /usr/src/postgresql; \
|
||||||
&& tar \
|
tar \
|
||||||
--extract \
|
--extract \
|
||||||
--file postgresql.tar.bz2 \
|
--file postgresql.tar.bz2 \
|
||||||
--directory /usr/src/postgresql \
|
--directory /usr/src/postgresql \
|
||||||
--strip-components 1 \
|
--strip-components 1 \
|
||||||
&& rm postgresql.tar.bz2 \
|
; \
|
||||||
|
rm postgresql.tar.bz2; \
|
||||||
\
|
\
|
||||||
&& apk add --no-cache --virtual .build-deps \
|
apk add --no-cache --virtual .build-deps \
|
||||||
bison \
|
bison \
|
||||||
coreutils \
|
coreutils \
|
||||||
dpkg-dev dpkg \
|
dpkg-dev dpkg \
|
||||||
@@ -58,20 +59,21 @@ RUN set -ex \
|
|||||||
# tcl-dev \
|
# tcl-dev \
|
||||||
util-linux-dev \
|
util-linux-dev \
|
||||||
zlib-dev \
|
zlib-dev \
|
||||||
|
; \
|
||||||
\
|
\
|
||||||
&& cd /usr/src/postgresql \
|
cd /usr/src/postgresql; \
|
||||||
# update "DEFAULT_PGSOCKET_DIR" to "/var/run/postgresql" (matching Debian)
|
# update "DEFAULT_PGSOCKET_DIR" to "/var/run/postgresql" (matching Debian)
|
||||||
# see https://anonscm.debian.org/git/pkg-postgresql/postgresql.git/tree/debian/patches/51-default-sockets-in-var.patch?id=8b539fcb3e093a521c095e70bdfa76887217b89f
|
# see https://anonscm.debian.org/git/pkg-postgresql/postgresql.git/tree/debian/patches/51-default-sockets-in-var.patch?id=8b539fcb3e093a521c095e70bdfa76887217b89f
|
||||||
&& awk '$1 == "#define" && $2 == "DEFAULT_PGSOCKET_DIR" && $3 == "\"/tmp\"" { $3 = "\"/var/run/postgresql\""; print; next } { print }' src/include/pg_config_manual.h > src/include/pg_config_manual.h.new \
|
awk '$1 == "#define" && $2 == "DEFAULT_PGSOCKET_DIR" && $3 == "\"/tmp\"" { $3 = "\"/var/run/postgresql\""; print; next } { print }' src/include/pg_config_manual.h > src/include/pg_config_manual.h.new; \
|
||||||
&& grep '/var/run/postgresql' src/include/pg_config_manual.h.new \
|
grep '/var/run/postgresql' src/include/pg_config_manual.h.new; \
|
||||||
&& mv src/include/pg_config_manual.h.new src/include/pg_config_manual.h \
|
mv src/include/pg_config_manual.h.new src/include/pg_config_manual.h; \
|
||||||
&& gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)" \
|
gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)"; \
|
||||||
# explicitly update autoconf config.guess and config.sub so they support more arches/libcs
|
# explicitly update autoconf config.guess and config.sub so they support more arches/libcs
|
||||||
&& wget -O config/config.guess 'https://git.savannah.gnu.org/cgit/config.git/plain/config.guess?id=7d3d27baf8107b630586c962c057e22149653deb' \
|
wget -O config/config.guess 'https://git.savannah.gnu.org/cgit/config.git/plain/config.guess?id=7d3d27baf8107b630586c962c057e22149653deb'; \
|
||||||
&& wget -O config/config.sub 'https://git.savannah.gnu.org/cgit/config.git/plain/config.sub?id=7d3d27baf8107b630586c962c057e22149653deb' \
|
wget -O config/config.sub 'https://git.savannah.gnu.org/cgit/config.git/plain/config.sub?id=7d3d27baf8107b630586c962c057e22149653deb'; \
|
||||||
# configure options taken from:
|
# configure options taken from:
|
||||||
# https://anonscm.debian.org/cgit/pkg-postgresql/postgresql.git/tree/debian/rules?h=9.5
|
# https://anonscm.debian.org/cgit/pkg-postgresql/postgresql.git/tree/debian/rules?h=9.5
|
||||||
&& ./configure \
|
./configure \
|
||||||
--build="$gnuArch" \
|
--build="$gnuArch" \
|
||||||
# "/usr/src/postgresql/src/backend/access/common/tupconvert.c:105: undefined reference to `libintl_gettext'"
|
# "/usr/src/postgresql/src/backend/access/common/tupconvert.c:105: undefined reference to `libintl_gettext'"
|
||||||
# --enable-nls \
|
# --enable-nls \
|
||||||
@@ -100,30 +102,35 @@ RUN set -ex \
|
|||||||
--with-openssl \
|
--with-openssl \
|
||||||
--with-libxml \
|
--with-libxml \
|
||||||
--with-libxslt \
|
--with-libxslt \
|
||||||
&& make -j "$(nproc)" world \
|
; \
|
||||||
&& make install-world \
|
make -j "$(nproc)" world; \
|
||||||
&& make -C contrib install \
|
make install-world; \
|
||||||
|
make -C contrib install; \
|
||||||
\
|
\
|
||||||
&& runDeps="$( \
|
runDeps="$( \
|
||||||
scanelf --needed --nobanner --format '%n#p' --recursive /usr/local \
|
scanelf --needed --nobanner --format '%n#p' --recursive /usr/local \
|
||||||
| tr ',' '\n' \
|
| tr ',' '\n' \
|
||||||
| sort -u \
|
| sort -u \
|
||||||
| awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \
|
| awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \
|
||||||
)" \
|
)"; \
|
||||||
&& apk add --no-cache --virtual .postgresql-rundeps \
|
apk add --no-cache --virtual .postgresql-rundeps \
|
||||||
$runDeps \
|
$runDeps \
|
||||||
bash \
|
bash \
|
||||||
su-exec \
|
su-exec \
|
||||||
# tzdata is optional, but only adds around 1Mb to image size and is recommended by Django documentation:
|
# tzdata is optional, but only adds around 1Mb to image size and is recommended by Django documentation:
|
||||||
# https://docs.djangoproject.com/en/1.10/ref/databases/#optimizing-postgresql-s-configuration
|
# https://docs.djangoproject.com/en/1.10/ref/databases/#optimizing-postgresql-s-configuration
|
||||||
tzdata \
|
tzdata \
|
||||||
&& apk del --no-network .build-deps \
|
; \
|
||||||
&& cd / \
|
apk del --no-network .build-deps; \
|
||||||
&& rm -rf \
|
cd /; \
|
||||||
|
rm -rf \
|
||||||
/usr/src/postgresql \
|
/usr/src/postgresql \
|
||||||
/usr/local/share/doc \
|
/usr/local/share/doc \
|
||||||
/usr/local/share/man \
|
/usr/local/share/man \
|
||||||
&& find /usr/local -name '*.a' -delete
|
; \
|
||||||
|
find /usr/local -name '*.a' -delete; \
|
||||||
|
\
|
||||||
|
postgres --version
|
||||||
|
|
||||||
# make the sample config easier to munge (and "correct by default")
|
# make the sample config easier to munge (and "correct by default")
|
||||||
RUN sed -ri "s!^#?(listen_addresses)\s*=\s*\S+.*!\1 = '*'!" /usr/local/share/postgresql/postgresql.conf.sample
|
RUN sed -ri "s!^#?(listen_addresses)\s*=\s*\S+.*!\1 = '*'!" /usr/local/share/postgresql/postgresql.conf.sample
|
||||||
|
|||||||
@@ -21,19 +21,20 @@ ENV PG_MAJOR 9.6
|
|||||||
ENV PG_VERSION 9.6.18
|
ENV PG_VERSION 9.6.18
|
||||||
ENV PG_SHA256 517ec282b785e6d22f360c30ba0c5e2a506fca5ca07dcc545427511d94c89999
|
ENV PG_SHA256 517ec282b785e6d22f360c30ba0c5e2a506fca5ca07dcc545427511d94c89999
|
||||||
|
|
||||||
RUN set -ex \
|
RUN set -eux; \
|
||||||
\
|
\
|
||||||
&& wget -O postgresql.tar.bz2 "https://ftp.postgresql.org/pub/source/v$PG_VERSION/postgresql-$PG_VERSION.tar.bz2" \
|
wget -O postgresql.tar.bz2 "https://ftp.postgresql.org/pub/source/v$PG_VERSION/postgresql-$PG_VERSION.tar.bz2"; \
|
||||||
&& echo "$PG_SHA256 *postgresql.tar.bz2" | sha256sum -c - \
|
echo "$PG_SHA256 *postgresql.tar.bz2" | sha256sum -c -; \
|
||||||
&& mkdir -p /usr/src/postgresql \
|
mkdir -p /usr/src/postgresql; \
|
||||||
&& tar \
|
tar \
|
||||||
--extract \
|
--extract \
|
||||||
--file postgresql.tar.bz2 \
|
--file postgresql.tar.bz2 \
|
||||||
--directory /usr/src/postgresql \
|
--directory /usr/src/postgresql \
|
||||||
--strip-components 1 \
|
--strip-components 1 \
|
||||||
&& rm postgresql.tar.bz2 \
|
; \
|
||||||
|
rm postgresql.tar.bz2; \
|
||||||
\
|
\
|
||||||
&& apk add --no-cache --virtual .build-deps \
|
apk add --no-cache --virtual .build-deps \
|
||||||
bison \
|
bison \
|
||||||
coreutils \
|
coreutils \
|
||||||
dpkg-dev dpkg \
|
dpkg-dev dpkg \
|
||||||
@@ -58,20 +59,21 @@ RUN set -ex \
|
|||||||
# tcl-dev \
|
# tcl-dev \
|
||||||
util-linux-dev \
|
util-linux-dev \
|
||||||
zlib-dev \
|
zlib-dev \
|
||||||
|
; \
|
||||||
\
|
\
|
||||||
&& cd /usr/src/postgresql \
|
cd /usr/src/postgresql; \
|
||||||
# update "DEFAULT_PGSOCKET_DIR" to "/var/run/postgresql" (matching Debian)
|
# update "DEFAULT_PGSOCKET_DIR" to "/var/run/postgresql" (matching Debian)
|
||||||
# see https://anonscm.debian.org/git/pkg-postgresql/postgresql.git/tree/debian/patches/51-default-sockets-in-var.patch?id=8b539fcb3e093a521c095e70bdfa76887217b89f
|
# see https://anonscm.debian.org/git/pkg-postgresql/postgresql.git/tree/debian/patches/51-default-sockets-in-var.patch?id=8b539fcb3e093a521c095e70bdfa76887217b89f
|
||||||
&& awk '$1 == "#define" && $2 == "DEFAULT_PGSOCKET_DIR" && $3 == "\"/tmp\"" { $3 = "\"/var/run/postgresql\""; print; next } { print }' src/include/pg_config_manual.h > src/include/pg_config_manual.h.new \
|
awk '$1 == "#define" && $2 == "DEFAULT_PGSOCKET_DIR" && $3 == "\"/tmp\"" { $3 = "\"/var/run/postgresql\""; print; next } { print }' src/include/pg_config_manual.h > src/include/pg_config_manual.h.new; \
|
||||||
&& grep '/var/run/postgresql' src/include/pg_config_manual.h.new \
|
grep '/var/run/postgresql' src/include/pg_config_manual.h.new; \
|
||||||
&& mv src/include/pg_config_manual.h.new src/include/pg_config_manual.h \
|
mv src/include/pg_config_manual.h.new src/include/pg_config_manual.h; \
|
||||||
&& gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)" \
|
gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)"; \
|
||||||
# explicitly update autoconf config.guess and config.sub so they support more arches/libcs
|
# explicitly update autoconf config.guess and config.sub so they support more arches/libcs
|
||||||
&& wget -O config/config.guess 'https://git.savannah.gnu.org/cgit/config.git/plain/config.guess?id=7d3d27baf8107b630586c962c057e22149653deb' \
|
wget -O config/config.guess 'https://git.savannah.gnu.org/cgit/config.git/plain/config.guess?id=7d3d27baf8107b630586c962c057e22149653deb'; \
|
||||||
&& wget -O config/config.sub 'https://git.savannah.gnu.org/cgit/config.git/plain/config.sub?id=7d3d27baf8107b630586c962c057e22149653deb' \
|
wget -O config/config.sub 'https://git.savannah.gnu.org/cgit/config.git/plain/config.sub?id=7d3d27baf8107b630586c962c057e22149653deb'; \
|
||||||
# configure options taken from:
|
# configure options taken from:
|
||||||
# https://anonscm.debian.org/cgit/pkg-postgresql/postgresql.git/tree/debian/rules?h=9.5
|
# https://anonscm.debian.org/cgit/pkg-postgresql/postgresql.git/tree/debian/rules?h=9.5
|
||||||
&& ./configure \
|
./configure \
|
||||||
--build="$gnuArch" \
|
--build="$gnuArch" \
|
||||||
# "/usr/src/postgresql/src/backend/access/common/tupconvert.c:105: undefined reference to `libintl_gettext'"
|
# "/usr/src/postgresql/src/backend/access/common/tupconvert.c:105: undefined reference to `libintl_gettext'"
|
||||||
# --enable-nls \
|
# --enable-nls \
|
||||||
@@ -100,30 +102,35 @@ RUN set -ex \
|
|||||||
--with-openssl \
|
--with-openssl \
|
||||||
--with-libxml \
|
--with-libxml \
|
||||||
--with-libxslt \
|
--with-libxslt \
|
||||||
&& make -j "$(nproc)" world \
|
; \
|
||||||
&& make install-world \
|
make -j "$(nproc)" world; \
|
||||||
&& make -C contrib install \
|
make install-world; \
|
||||||
|
make -C contrib install; \
|
||||||
\
|
\
|
||||||
&& runDeps="$( \
|
runDeps="$( \
|
||||||
scanelf --needed --nobanner --format '%n#p' --recursive /usr/local \
|
scanelf --needed --nobanner --format '%n#p' --recursive /usr/local \
|
||||||
| tr ',' '\n' \
|
| tr ',' '\n' \
|
||||||
| sort -u \
|
| sort -u \
|
||||||
| awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \
|
| awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \
|
||||||
)" \
|
)"; \
|
||||||
&& apk add --no-cache --virtual .postgresql-rundeps \
|
apk add --no-cache --virtual .postgresql-rundeps \
|
||||||
$runDeps \
|
$runDeps \
|
||||||
bash \
|
bash \
|
||||||
su-exec \
|
su-exec \
|
||||||
# tzdata is optional, but only adds around 1Mb to image size and is recommended by Django documentation:
|
# tzdata is optional, but only adds around 1Mb to image size and is recommended by Django documentation:
|
||||||
# https://docs.djangoproject.com/en/1.10/ref/databases/#optimizing-postgresql-s-configuration
|
# https://docs.djangoproject.com/en/1.10/ref/databases/#optimizing-postgresql-s-configuration
|
||||||
tzdata \
|
tzdata \
|
||||||
&& apk del --no-network .build-deps \
|
; \
|
||||||
&& cd / \
|
apk del --no-network .build-deps; \
|
||||||
&& rm -rf \
|
cd /; \
|
||||||
|
rm -rf \
|
||||||
/usr/src/postgresql \
|
/usr/src/postgresql \
|
||||||
/usr/local/share/doc \
|
/usr/local/share/doc \
|
||||||
/usr/local/share/man \
|
/usr/local/share/man \
|
||||||
&& find /usr/local -name '*.a' -delete
|
; \
|
||||||
|
find /usr/local -name '*.a' -delete; \
|
||||||
|
\
|
||||||
|
postgres --version
|
||||||
|
|
||||||
# make the sample config easier to munge (and "correct by default")
|
# make the sample config easier to munge (and "correct by default")
|
||||||
RUN sed -ri "s!^#?(listen_addresses)\s*=\s*\S+.*!\1 = '*'!" /usr/local/share/postgresql/postgresql.conf.sample
|
RUN sed -ri "s!^#?(listen_addresses)\s*=\s*\S+.*!\1 = '*'!" /usr/local/share/postgresql/postgresql.conf.sample
|
||||||
|
|||||||
@@ -21,19 +21,20 @@ ENV PG_MAJOR %%PG_MAJOR%%
|
|||||||
ENV PG_VERSION %%PG_VERSION%%
|
ENV PG_VERSION %%PG_VERSION%%
|
||||||
ENV PG_SHA256 %%PG_SHA256%%
|
ENV PG_SHA256 %%PG_SHA256%%
|
||||||
|
|
||||||
RUN set -ex \
|
RUN set -eux; \
|
||||||
\
|
\
|
||||||
&& wget -O postgresql.tar.bz2 "https://ftp.postgresql.org/pub/source/v$PG_VERSION/postgresql-$PG_VERSION.tar.bz2" \
|
wget -O postgresql.tar.bz2 "https://ftp.postgresql.org/pub/source/v$PG_VERSION/postgresql-$PG_VERSION.tar.bz2"; \
|
||||||
&& echo "$PG_SHA256 *postgresql.tar.bz2" | sha256sum -c - \
|
echo "$PG_SHA256 *postgresql.tar.bz2" | sha256sum -c -; \
|
||||||
&& mkdir -p /usr/src/postgresql \
|
mkdir -p /usr/src/postgresql; \
|
||||||
&& tar \
|
tar \
|
||||||
--extract \
|
--extract \
|
||||||
--file postgresql.tar.bz2 \
|
--file postgresql.tar.bz2 \
|
||||||
--directory /usr/src/postgresql \
|
--directory /usr/src/postgresql \
|
||||||
--strip-components 1 \
|
--strip-components 1 \
|
||||||
&& rm postgresql.tar.bz2 \
|
; \
|
||||||
|
rm postgresql.tar.bz2; \
|
||||||
\
|
\
|
||||||
&& apk add --no-cache --virtual .build-deps \
|
apk add --no-cache --virtual .build-deps \
|
||||||
bison \
|
bison \
|
||||||
coreutils \
|
coreutils \
|
||||||
dpkg-dev dpkg \
|
dpkg-dev dpkg \
|
||||||
@@ -60,20 +61,21 @@ RUN set -ex \
|
|||||||
util-linux-dev \
|
util-linux-dev \
|
||||||
zlib-dev \
|
zlib-dev \
|
||||||
icu-dev \
|
icu-dev \
|
||||||
|
; \
|
||||||
\
|
\
|
||||||
&& cd /usr/src/postgresql \
|
cd /usr/src/postgresql; \
|
||||||
# update "DEFAULT_PGSOCKET_DIR" to "/var/run/postgresql" (matching Debian)
|
# update "DEFAULT_PGSOCKET_DIR" to "/var/run/postgresql" (matching Debian)
|
||||||
# see https://anonscm.debian.org/git/pkg-postgresql/postgresql.git/tree/debian/patches/51-default-sockets-in-var.patch?id=8b539fcb3e093a521c095e70bdfa76887217b89f
|
# see https://anonscm.debian.org/git/pkg-postgresql/postgresql.git/tree/debian/patches/51-default-sockets-in-var.patch?id=8b539fcb3e093a521c095e70bdfa76887217b89f
|
||||||
&& awk '$1 == "#define" && $2 == "DEFAULT_PGSOCKET_DIR" && $3 == "\"/tmp\"" { $3 = "\"/var/run/postgresql\""; print; next } { print }' src/include/pg_config_manual.h > src/include/pg_config_manual.h.new \
|
awk '$1 == "#define" && $2 == "DEFAULT_PGSOCKET_DIR" && $3 == "\"/tmp\"" { $3 = "\"/var/run/postgresql\""; print; next } { print }' src/include/pg_config_manual.h > src/include/pg_config_manual.h.new; \
|
||||||
&& grep '/var/run/postgresql' src/include/pg_config_manual.h.new \
|
grep '/var/run/postgresql' src/include/pg_config_manual.h.new; \
|
||||||
&& mv src/include/pg_config_manual.h.new src/include/pg_config_manual.h \
|
mv src/include/pg_config_manual.h.new src/include/pg_config_manual.h; \
|
||||||
&& gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)" \
|
gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)"; \
|
||||||
# explicitly update autoconf config.guess and config.sub so they support more arches/libcs
|
# explicitly update autoconf config.guess and config.sub so they support more arches/libcs
|
||||||
&& wget -O config/config.guess 'https://git.savannah.gnu.org/cgit/config.git/plain/config.guess?id=7d3d27baf8107b630586c962c057e22149653deb' \
|
wget -O config/config.guess 'https://git.savannah.gnu.org/cgit/config.git/plain/config.guess?id=7d3d27baf8107b630586c962c057e22149653deb'; \
|
||||||
&& wget -O config/config.sub 'https://git.savannah.gnu.org/cgit/config.git/plain/config.sub?id=7d3d27baf8107b630586c962c057e22149653deb' \
|
wget -O config/config.sub 'https://git.savannah.gnu.org/cgit/config.git/plain/config.sub?id=7d3d27baf8107b630586c962c057e22149653deb'; \
|
||||||
# configure options taken from:
|
# configure options taken from:
|
||||||
# https://anonscm.debian.org/cgit/pkg-postgresql/postgresql.git/tree/debian/rules?h=9.5
|
# https://anonscm.debian.org/cgit/pkg-postgresql/postgresql.git/tree/debian/rules?h=9.5
|
||||||
&& ./configure \
|
./configure \
|
||||||
--build="$gnuArch" \
|
--build="$gnuArch" \
|
||||||
# "/usr/src/postgresql/src/backend/access/common/tupconvert.c:105: undefined reference to `libintl_gettext'"
|
# "/usr/src/postgresql/src/backend/access/common/tupconvert.c:105: undefined reference to `libintl_gettext'"
|
||||||
# --enable-nls \
|
# --enable-nls \
|
||||||
@@ -104,30 +106,35 @@ RUN set -ex \
|
|||||||
--with-libxslt \
|
--with-libxslt \
|
||||||
--with-icu \
|
--with-icu \
|
||||||
--with-llvm \
|
--with-llvm \
|
||||||
&& make -j "$(nproc)" world \
|
; \
|
||||||
&& make install-world \
|
make -j "$(nproc)" world; \
|
||||||
&& make -C contrib install \
|
make install-world; \
|
||||||
|
make -C contrib install; \
|
||||||
\
|
\
|
||||||
&& runDeps="$( \
|
runDeps="$( \
|
||||||
scanelf --needed --nobanner --format '%n#p' --recursive /usr/local \
|
scanelf --needed --nobanner --format '%n#p' --recursive /usr/local \
|
||||||
| tr ',' '\n' \
|
| tr ',' '\n' \
|
||||||
| sort -u \
|
| sort -u \
|
||||||
| awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \
|
| awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \
|
||||||
)" \
|
)"; \
|
||||||
&& apk add --no-cache --virtual .postgresql-rundeps \
|
apk add --no-cache --virtual .postgresql-rundeps \
|
||||||
$runDeps \
|
$runDeps \
|
||||||
bash \
|
bash \
|
||||||
su-exec \
|
su-exec \
|
||||||
# tzdata is optional, but only adds around 1Mb to image size and is recommended by Django documentation:
|
# tzdata is optional, but only adds around 1Mb to image size and is recommended by Django documentation:
|
||||||
# https://docs.djangoproject.com/en/1.10/ref/databases/#optimizing-postgresql-s-configuration
|
# https://docs.djangoproject.com/en/1.10/ref/databases/#optimizing-postgresql-s-configuration
|
||||||
tzdata \
|
tzdata \
|
||||||
&& apk del --no-network .build-deps \
|
; \
|
||||||
&& cd / \
|
apk del --no-network .build-deps; \
|
||||||
&& rm -rf \
|
cd /; \
|
||||||
|
rm -rf \
|
||||||
/usr/src/postgresql \
|
/usr/src/postgresql \
|
||||||
/usr/local/share/doc \
|
/usr/local/share/doc \
|
||||||
/usr/local/share/man \
|
/usr/local/share/man \
|
||||||
&& find /usr/local -name '*.a' -delete
|
; \
|
||||||
|
find /usr/local -name '*.a' -delete; \
|
||||||
|
\
|
||||||
|
postgres --version
|
||||||
|
|
||||||
# make the sample config easier to munge (and "correct by default")
|
# make the sample config easier to munge (and "correct by default")
|
||||||
RUN sed -ri "s!^#?(listen_addresses)\s*=\s*\S+.*!\1 = '*'!" /usr/local/share/postgresql/postgresql.conf.sample
|
RUN sed -ri "s!^#?(listen_addresses)\s*=\s*\S+.*!\1 = '*'!" /usr/local/share/postgresql/postgresql.conf.sample
|
||||||
|
|||||||
Reference in New Issue
Block a user