diff --git a/CHANGELOG.md b/CHANGELOG.md index 4b91792..6444ac8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,8 @@ -## 1.1 - 2017-11-17 - +## 1.4 - 2017-11-17 - + +* Switch to Packages Postgres + +## 1.31 - 2017-11-17 - * Fix to SPLIT_DB Postgresql Backup diff --git a/Dockerfile b/Dockerfile index f9ff829..4e2fba0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -13,67 +13,13 @@ LABEL maintainer="Dave Conroy (dave at tiredofit dot ca)" influxdb@testing \ mongodb-tools \ mysql-client \ - openssl \ + postgresql \ + postgresql-client \ + openssl \ redis \ xz \ && \ -### Build Postgres 10 - mkdir -p /usr/src/postgresql && \ - curl https://ftp.postgresql.org/pub/source/v10.0/postgresql-10.0.tar.bz2 | tar xvfj - --strip 1 -C /usr/src/postgresql && \ - - apk add --no-cache --virtual .build-deps \ - bison \ - coreutils \ - dpkg-dev dpkg \ - flex \ - gcc \ - libc-dev \ - libedit-dev \ - libxml2-dev \ - libxslt-dev \ - make \ - openssl-dev \ - perl-utils \ - perl-ipc-run \ - util-linux-dev \ - zlib-dev \ - && \ - cd /usr/src/postgresql && \ - 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)" && \ - 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' && \ - ./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 && \ - make -j "$(nproc)" world && \ - make install-world && \ - make -C contrib install && \ - \ - apk del .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/* diff --git a/install/etc/s6/services/10-db-backup/run b/install/etc/s6/services/10-db-backup/run index 26d8b63..0e4db4a 100755 --- a/install/etc/s6/services/10-db-backup/run +++ b/install/etc/s6/services/10-db-backup/run @@ -123,13 +123,13 @@ function backup_mongo() { } function backup_pgsql() { - if [ "$SPLIT_DB" = "TRUE" ] || [ "$SPLIT_DB" = "true" ]; then + if [ "$SPLIT_DB" = "TRUE" ] || [ "$SPLIT_DB" = "true" ]; then export PGPASSWORD=${DBPASS} - DATABASES=psql -h $DBHOST -U $DBUSER -c 'COPY (SELECT datname FROM pg_database WHERE datistemplate = false) TO STDOUT;' ) + DATABASES=`psql -h $DBHOST -U $DBUSER -c 'COPY (SELECT datname FROM pg_database WHERE datistemplate = false) TO STDOUT;' ` for db in $DATABASES; do echo "** [db-backup] Dumping database: $db" TARGET=pgsql_${db}_${DBHOST}_${now}.sql - pg_dump -h ${DBHOST} -p ${DBPORT}-U ${DBUSER} $db > ${TMPDIR}/${TARGET} + pg_dump -h ${DBHOST} -p ${DBPORT} -U ${DBUSER} $db > ${TMPDIR}/${TARGET} generate_md5 compression move_backup