@@ -10,104 +10,8 @@ ENV INFLUX2_VERSION=2.4.0 \
1010 IMAGE_NAME="tiredofit/db-backup" \
1111 IMAGE_REPO_URL="https://github.com/tiredofit/docker-db-backup/"
1212
13- ENV LANG=en_US.utf8 \
14- PG_MAJOR=15 \
15- PG_VERSION=15.1 \
16- PGDATA=/var/lib/postgresql/data
17-
18- # ## Create User Accounts
19- RUN set -ex && \
20- addgroup -g 70 postgres && \
21- adduser -S -D -H -h /var/lib/postgresql -s /bin/sh -G postgres -u 70 postgres && \
22- mkdir -p /var/lib/postgresql && \
23- chown -R postgres:postgres /var/lib/postgresql && \
24- \
25- # ## Install Dependencies
26- apk update && \
27- apk upgrade && \
28- apk add \
29- openssl \
30- && \
31- \
32- apk add --no-cache --virtual .postgres-build-deps \
33- bison \
34- build-base \
35- coreutils \
36- dpkg-dev \
37- dpkg \
38- flex \
39- gcc \
40- icu-dev \
41- libc-dev \
42- libedit-dev \
43- libxml2-dev \
44- libxslt-dev \
45- linux-headers \
46- make \
47- openssl-dev \
48- perl-utils \
49- perl-ipc-run \
50- util-linux-dev \
51- wget \
52- zlib-dev \
53- && \
54- \
55- # ## Build Postgresql
56- mkdir -p /usr/src/postgresql && \
57- curl -sSL "https://ftp.postgresql.org/pub/source/v$PG_VERSION/postgresql-$PG_VERSION.tar.bz2" | tar xvfj - --strip 1 -C /usr/src/postgresql && \
58- cd /usr/src/postgresql && \
59- # update "DEFAULT_PGSOCKET_DIR" to "/var/run/postgresql" (matching Debian)
60- # see https://anonscm.debian.org/git/pkg-postgresql/postgresql.git/tree/debian/patches/51-default-sockets-in-var.patch?id=8b539fcb3e093a521c095e70bdfa76887217b89f
61- 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 && \
62- grep '/var/run/postgresql' src/include/pg_config_manual.h.new && \
63- mv src/include/pg_config_manual.h.new src/include/pg_config_manual.h && \
64- gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)" && \
65- # explicitly update autoconf config.guess and config.sub so they support more arches/libcs
66- wget --inet4-only -O config/config.guess 'https://git.savannah.gnu.org/cgit/config.git/plain/config.guess?id=7d3d27baf8107b630586c962c057e22149653deb' && \
67- wget --inet4-only -O config/config.sub 'https://git.savannah.gnu.org/cgit/config.git/plain/config.sub?id=7d3d27baf8107b630586c962c057e22149653deb' && \
68- ./configure \
69- --build="$gnuArch" \
70- --enable-integer-datetimes \
71- --enable-thread-safety \
72- --enable-tap-tests \
73- --disable-rpath \
74- --with-uuid=e2fs \
75- --with-gnu-ld \
76- --with-pgport=5432 \
77- --with-system-tzdata=/usr/share/zoneinfo \
78- --prefix=/usr/local \
79- --with-includes=/usr/local/include \
80- --with-libraries=/usr/local/lib \
81- --with-openssl \
82- --with-libxml \
83- --with-libxslt \
84- --with-icu \
85- && \
86- \
87- make -j "$(nproc)" world && \
88- make install-world && \
89- make -C contrib install && \
90- runDeps="$( \
91- scanelf --needed --nobanner --format '%n#p' --recursive /usr/local \
92- | tr ',' '\n ' \
93- | sort -u \
94- | awk 'system(" [ -e /usr/local/lib/" $1 " ]") == 0 { next } { print " so:" $1 }' \
95- )" && \
96- apk add -t .postgres-additional-deps \
97- $runDeps \
98- && \
99- \
100- # ## Cleanup
101- apk del .postgres-build-deps && \
102- cd / && \
103- rm -rf \
104- /usr/src/postgresql \
105- /usr/local/share/doc \
106- /usr/local/share/man && \
107- find /usr/local -name '*.a' -delete && \
108- rm -rf /var/cache/apk/* && \
109- \
11013# ## Dependencies
14+ RUN source /assets/functions/00-container && \
11115 set -ex && \
11216 apk update && \
11317 apk upgrade && \
@@ -133,8 +37,8 @@ RUN set -ex && \
13337 mongodb-tools \
13438 openssl \
13539 pigz \
136- # postgresql \
137- # postgresql -client \
40+ postgresql15 \
41+ postgresql15 -client \
13842 pv \
13943 py3-cryptography \
14044 redis \
0 commit comments