From 89b6176188aa1824fc66f391d5c583e6d179ba4a Mon Sep 17 00:00:00 2001 From: "dave@tiredofit.ca" Date: Mon, 21 Nov 2022 12:32:33 -0800 Subject: [PATCH] Release 3.6.0 - See CHANGELOG.md --- CHANGELOG.md | 6 ++ Dockerfile | 104 +++++++++++++++++++++++++- install/assets/functions/10-db-backup | 2 - 3 files changed, 106 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 034b91a..5ba44a6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +## 3.6.0 2022-11-21 + + ### Added + - Postgresql 15 Support + + ## 3.5.6 2022-11-15 ### Changed diff --git a/Dockerfile b/Dockerfile index 4c16747..9530413 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,7 +2,6 @@ FROM docker.io/tiredofit/alpine:3.16 LABEL maintainer="Dave Conroy (github.com/tiredofit)" ### Set Environment Variables - ENV INFLUX2_VERSION=2.4.0 \ MSSQL_VERSION=18.0.1.1-1 \ CONTAINER_ENABLE_MESSAGING=FALSE \ @@ -11,8 +10,105 @@ ENV INFLUX2_VERSION=2.4.0 \ IMAGE_NAME="tiredofit/db-backup" \ IMAGE_REPO_URL="https://github.com/tiredofit/docker-db-backup/" -### Dependencies +ENV LANG=en_US.utf8 \ + PG_MAJOR=15 \ + PG_VERSION=15.1 \ + PGDATA=/var/lib/postgresql/data + +### Create User Accounts RUN set -ex && \ + addgroup -g 70 postgres && \ + adduser -S -D -H -h /var/lib/postgresql -s /bin/sh -G postgres -u 70 postgres && \ + mkdir -p /var/lib/postgresql && \ + chown -R postgres:postgres /var/lib/postgresql && \ + \ +### Install Dependencies + apk update && \ + apk upgrade && \ + apk add \ + openssl \ + && \ + \ + apk add --no-cache --virtual .postgres-build-deps \ + bison \ + build-base \ + coreutils \ + dpkg-dev \ + dpkg \ + flex \ + gcc \ + icu-dev \ + libc-dev \ + libedit-dev \ + libxml2-dev \ + libxslt-dev \ + linux-headers \ + make \ + openssl-dev \ + perl-utils \ + perl-ipc-run \ + util-linux-dev \ + wget \ + zlib-dev \ + && \ + \ +### Build Postgresql + mkdir -p /usr/src/postgresql && \ + curl -sSL "https://ftp.postgresql.org/pub/source/v$PG_VERSION/postgresql-$PG_VERSION.tar.bz2" | tar xvfj - --strip 1 -C /usr/src/postgresql && \ + cd /usr/src/postgresql && \ +# 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 + 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 && \ + mv src/include/pg_config_manual.h.new src/include/pg_config_manual.h && \ + gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)" && \ +# explicitly update autoconf config.guess and config.sub so they support more arches/libcs + wget --inet4-only -O config/config.guess 'https://git.savannah.gnu.org/cgit/config.git/plain/config.guess?id=7d3d27baf8107b630586c962c057e22149653deb' && \ + wget --inet4-only -O config/config.sub 'https://git.savannah.gnu.org/cgit/config.git/plain/config.sub?id=7d3d27baf8107b630586c962c057e22149653deb' && \ + ./configure \ + --build="$gnuArch" \ + --enable-integer-datetimes \ + --enable-thread-safety \ + --enable-tap-tests \ + --disable-rpath \ + --with-uuid=e2fs \ + --with-gnu-ld \ + --with-pgport=5432 \ + --with-system-tzdata=/usr/share/zoneinfo \ + --prefix=/usr/local \ + --with-includes=/usr/local/include \ + --with-libraries=/usr/local/lib \ + --with-openssl \ + --with-libxml \ + --with-libxslt \ + --with-icu \ + && \ + \ + make -j "$(nproc)" world && \ + make install-world && \ + make -C contrib install && \ + runDeps="$( \ + scanelf --needed --nobanner --format '%n#p' --recursive /usr/local \ + | tr ',' '\n' \ + | sort -u \ + | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \ + )" && \ + apk add -t .postgres-additional-deps \ + $runDeps \ + && \ + \ +### Cleanup + apk del .postgres-build-deps && \ + cd / && \ + rm -rf \ + /usr/src/postgresql \ + /usr/local/share/doc \ + /usr/local/share/man && \ + find /usr/local -name '*.a' -delete && \ + rm -rf /var/cache/apk/* && \ + \ +### Dependencies + set -ex && \ apk update && \ apk upgrade && \ apk add -t .db-backup-build-deps \ @@ -37,8 +133,8 @@ RUN set -ex && \ mongodb-tools \ libressl \ pigz \ - postgresql \ - postgresql-client \ + #postgresql \ + #postgresql-client \ pv \ py3-cryptography \ redis \ diff --git a/install/assets/functions/10-db-backup b/install/assets/functions/10-db-backup index 292436b..1ebcf20 100644 --- a/install/assets/functions/10-db-backup +++ b/install/assets/functions/10-db-backup @@ -85,8 +85,6 @@ bootstrap_variables() { file_env 'S3_KEY_ID' file_env 'S3_KEY_SECRET' fi - - } backup_couch() {