@@ -2,7 +2,6 @@ FROM docker.io/tiredofit/alpine:3.16
2
2
LABEL maintainer="Dave Conroy (github.com/tiredofit)"
3
3
4
4
# ## Set Environment Variables
5
-
6
5
ENV INFLUX2_VERSION=2.4.0 \
7
6
MSSQL_VERSION=18.0.1.1-1 \
8
7
CONTAINER_ENABLE_MESSAGING=FALSE \
@@ -11,8 +10,105 @@ ENV INFLUX2_VERSION=2.4.0 \
11
10
IMAGE_NAME="tiredofit/db-backup" \
12
11
IMAGE_REPO_URL="https://github.com/tiredofit/docker-db-backup/"
13
12
14
- # ## Dependencies
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
15
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
+ \
110
+ # ## Dependencies
111
+ set -ex && \
16
112
apk update && \
17
113
apk upgrade && \
18
114
apk add -t .db-backup-build-deps \
@@ -37,8 +133,8 @@ RUN set -ex && \
37
133
mongodb-tools \
38
134
libressl \
39
135
pigz \
40
- postgresql \
41
- postgresql-client \
136
+ # postgresql \
137
+ # postgresql-client \
42
138
pv \
43
139
py3-cryptography \
44
140
redis \
0 commit comments