11ARG DISTRO=alpine
2- ARG DISTRO_VARIANT=3.20
2+ ARG DISTRO_VARIANT=3.20-7.10.17
33
44FROM docker.io/tiredofit/${DISTRO}:${DISTRO_VARIANT}
55LABEL maintainer="Dave Conroy (github.com/tiredofit)"
66
77# ## Set Environment Variables
88ENV INFLUX1_CLIENT_VERSION=1.8.0 \
9- INFLUX2_CLIENT_VERSION=2.7.3 \
10- MSODBC_VERSION=18.3.2 .1-1 \
11- MSSQL_VERSION=18.3 .1.1-1 \
12- MYSQL_VERSION=mysql-8.4.0 \
9+ INFLUX2_CLIENT_VERSION=2.7.5 \
10+ MSODBC_VERSION=18.4.1 .1-1 \
11+ MSSQL_VERSION=18.4 .1.1-1 \
12+ MYSQL_VERSION=mysql-8.4.3 \
1313 MYSQL_REPO_URL=https://github.com/mysql/mysql-server \
14- AWS_CLI_VERSION=1.32.113 \
14+ AWS_CLI_VERSION=1.35.13 \
1515 CONTAINER_ENABLE_MESSAGING=TRUE \
1616 CONTAINER_ENABLE_MONITORING=TRUE \
1717 IMAGE_NAME="tiredofit/db-backup" \
1818 IMAGE_REPO_URL="https://github.com/tiredofit/docker-db-backup/"
1919
2020# ## Dependencies
21+ ENV POSTGRES_VERSION=${POSTGRES_VERSION:-"17.0" }
22+
23+ # ## Create User Accounts
2124RUN source /assets/functions/00-container && \
2225 set -ex && \
26+ addgroup -g 70 postgres && \
27+ adduser -S -D -H -h /var/lib/postgresql -s /bin/sh -G postgres -u 70 postgres && \
28+ mkdir -p /var/lib/postgresql && \
29+ chown -R postgres:postgres /var/lib/postgresql && \
30+ \
31+ package update && \
32+ package upgrade && \
33+ package install .postgres-build-deps \
34+ bison \
35+ clang15 \
36+ coreutils \
37+ dpkg-dev \
38+ dpkg \
39+ flex \
40+ g++ \
41+ gcc \
42+ icu-dev \
43+ libc-dev \
44+ libedit-dev \
45+ libxml2-dev \
46+ libxslt-dev \
47+ linux-headers \
48+ llvm15-dev \
49+ lz4-dev \
50+ make \
51+ openldap-dev \
52+ openssl-dev \
53+ perl-dev \
54+ perl-ipc-run \
55+ perl-utils \
56+ python3-dev \
57+ tcl-dev \
58+ util-linux-dev \
59+ zlib-dev \
60+ zstd-dev \
61+ && \
62+ \
63+ package install .postgres-run-deps \
64+ icu-data-full \
65+ libpq-dev \
66+ llvm15 \
67+ musl-locales \
68+ openssl \
69+ zstd-libs \
70+ && \
71+ \
72+ mkdir -p /usr/src/postgres && \
73+ curl -sSL https://ftp.postgresql.org/pub/source/v$POSTGRES_VERSION/postgresql-$POSTGRES_VERSION.tar.bz2 | tar xvfj - --strip 1 -C /usr/src/postgres && \
74+ cd /usr/src/postgres && \
75+ 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 && \
76+ grep '/var/run/postgresql' src/include/pg_config_manual.h.new && \
77+ mv src/include/pg_config_manual.h.new src/include/pg_config_manual.h && \
78+ wget -O config/config.guess 'https://git.savannah.gnu.org/cgit/config.git/plain/config.guess?id=7d3d27baf8107b630586c962c057e22149653deb' && \
79+ wget -O config/config.sub 'https://git.savannah.gnu.org/cgit/config.git/plain/config.sub?id=7d3d27baf8107b630586c962c057e22149653deb' && \
80+ export LLVM_CONFIG="/usr/lib/llvm15/bin/llvm-config" && \
81+ export CLANG=clang-15 && \
82+ ./configure \
83+ --build="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)" \
84+ --prefix=/usr/local \
85+ --with-includes=/usr/local/include \
86+ --with-libraries=/usr/local/lib \
87+ --with-system-tzdata=/usr/share/zoneinfo \
88+ --with-pgport=5432 \
89+ --disable-rpath \
90+ --enable-integer-datetimes \
91+ --enable-tap-tests \
92+ --with-gnu-ld \
93+ --with-icu \
94+ --with-ldap \
95+ --with-libxml \
96+ --with-libxslt \
97+ --with-llvm \
98+ --with-lz4 \
99+ --with-openssl \
100+ --with-perl \
101+ --with-python \
102+ --with-tcl \
103+ --with-uuid=e2fs \
104+ --with-zstd \
105+ && \
106+ make -j "$(nproc)" world && \
107+ make install-world && \
108+ make -j "$(nproc)" -C contrib && \
109+ make -C contrib/ install && \
110+ runDeps="$( \
111+ scanelf --needed --nobanner --format '%n#p' --recursive /usr/local \
112+ | tr ',' '\n ' \
113+ | sort -u \
114+ | awk 'system(" [ -e /usr/local/lib/" $1 " ]") == 0 { next } { print " so:" $1 }' \
115+ | grep -v -e perl -e python -e tcl \
116+ )" ; \
117+ package install .postgres-additional-deps \
118+ $runDeps \
119+ && \
120+ \
121+ package remove \
122+ .postgres-build-deps \
123+ && \
124+ package cleanup && \
125+ find /usr/local -name '*.a' -delete && \
126+ rm -rf \
127+ /root/.cache \
128+ /root/go \
129+ /usr/local/share/doc \
130+ /usr/local/share/man \
131+ /usr/src/* \
132+ && \
133+ set -ex && \
23134 addgroup -S -g 10000 dbbackup && \
24135 adduser -S -D -H -u 10000 -G dbbackup -g "Tired of I.T! DB Backup" dbbackup && \
25136 \
@@ -55,8 +166,6 @@ RUN source /assets/functions/00-container && \
55166 openssl \
56167 pigz \
57168 pixz \
58- postgresql16 \
59- postgresql16-client \
60169 pv \
61170 py3-botocore \
62171 py3-colorama \
@@ -75,15 +184,24 @@ RUN source /assets/functions/00-container && \
75184 zstd \
76185 && \
77186 \
78- apkArch="$(uname -m)" ; \
79- case "$apkArch" in \
80- x86_64) mssql=true ; mssql_arch=amd64; influx2=true ; influx_arch=amd64; ;; \
81- arm64 | aarch64 ) mssql=true ; mssql_arch=amd64; influx2=true ; influx_arch=arm64 ;; \
187+ source /assets/functions/00-container && \
188+ cd /usr/src/ && \
189+ case "$(uname -m)" in \
190+ "x86_64" ) mssql=true ; mssql_arch=amd64; influx2=true ; influx_arch=amd64; ;; \
191+ "arm64" | "aarch64" ) mssql=true ; mssql_arch=arm64; influx2=true ; influx_arch=arm64 ;; \
82192 *) sleep 0.1 ;; \
83193 esac; \
84194 \
85- if [[ $mssql = "true" ]] ; then curl -O https://download.microsoft.com/download/3/5/5/355d7943-a338-41a7-858d-53b259ea33f5/msodbcsql18_${MSODBC_VERSION}_${mssql_arch}.apk ; curl -O https://download.microsoft.com/download/3/5/5/355d7943-a338-41a7-858d-53b259ea33f5/mssql-tools18_${MSSQL_VERSION}_${mssql_arch}.apk ; echo y | apk add --allow-untrusted msodbcsql18_${MSODBC_VERSION}_${mssql_arch}.apk mssql-tools18_${MSSQL_VERSION}_${mssql_arch}.apk ; else echo >&2 "Detected non x86_64 or ARM64 build variant, skipping MSSQL installation" ; fi; \
86- if [[ $influx2 = "true" ]] ; then curl -sSL https://dl.influxdata.com/influxdb/releases/influxdb2-client-${INFLUX2_CLIENT_VERSION}-linux-${influx_arch}.tar.gz | tar xvfz - --strip=1 -C /usr/src/ ; chmod +x /usr/src/influx ; mv /usr/src/influx /usr/sbin/ ; else echo >&2 "Unable to build Influx 2 on this system" ; fi ; \
195+ if [ "${mssql,,}" = "true" ] ; then \
196+ curl -sSLO https://download.microsoft.com/download/7/6/d/76de322a-d860-4894-9945-f0cc5d6a45f8/msodbcsql18_${MSODBC_VERSION}_${mssql_arch}.apk ; \
197+ curl -sSLO https://download.microsoft.com/download/7/6/d/76de322a-d860-4894-9945-f0cc5d6a45f8/mssql-tools18_${MSSQL_VERSION}_${mssql_arch}.apk ; \
198+ echo y | apk add --allow-untrusted msodbcsql18_${MSODBC_VERSION}_${mssql_arch}.apk mssql-tools18_${MSSQL_VERSION}_${mssql_arch}.apk ; \
199+ else \
200+ echo >&2 "Detected non x86_64 or ARM64 build variant, skipping MSSQL installation" ; \
201+ fi; \
202+ \
203+ if [ "${influx2,,}" = "true" ] ; then curl -sSL https://dl.influxdata.com/influxdb/releases/influxdb2-client-${INFLUX2_CLIENT_VERSION}-linux-${influx_arch}.tar.gz | tar xvfz - --strip=1 -C /usr/src/ ; chmod +x /usr/src/influx ; mv /usr/src/influx /usr/sbin/ ; else echo >&2 "Unable to build Influx 2 on this system" ; fi ; \
204+ sleep 30 && \
87205 clone_git_repo https://github.com/influxdata/influxdb "${INFLUX1_CLIENT_VERSION}" && \
88206 go build -o /usr/sbin/influxd ./cmd/influxd && \
89207 strip /usr/sbin/influxd && \
0 commit comments