From 7df4af90fc7da7a8096bdb4b42c3bef68361174f Mon Sep 17 00:00:00 2001 From: Armin Nesiren Date: Tue, 16 Jul 2024 17:01:57 +0200 Subject: [PATCH 1/9] Re-enabling a cron --- cron_unprivileged.c | 16 +++++++++++++ docker/postgres/Dockerfile | 8 +++++++ runit/cron/run | 2 +- scripts/configure_spilo.py | 24 +++++++++++++++---- scripts/pgbackrest/standalone/pgbackrest.conf | 14 +++++++++++ 5 files changed, 59 insertions(+), 5 deletions(-) create mode 100644 cron_unprivileged.c create mode 100644 scripts/pgbackrest/standalone/pgbackrest.conf diff --git a/cron_unprivileged.c b/cron_unprivileged.c new file mode 100644 index 0000000..889f188 --- /dev/null +++ b/cron_unprivileged.c @@ -0,0 +1,16 @@ +#include + +int setuid(uid_t euid) +{ + return 0; +} + +int seteuid(uid_t euid) +{ + return 0; +} + +int initgroups(const char *user, gid_t group) +{ + return 0; +} diff --git a/docker/postgres/Dockerfile b/docker/postgres/Dockerfile index bc36288..89ad23f 100644 --- a/docker/postgres/Dockerfile +++ b/docker/postgres/Dockerfile @@ -61,6 +61,7 @@ RUN if [ "$BASEOS" = "ubi8" ] ; then \ rsync \ dumb-init \ libicu \ + cronie \ pgbackrest-${PGBACKREST_VERSION} \ && ${PACKAGER} -y clean all ; \ else \ @@ -99,10 +100,14 @@ else \ rsync \ dumb-init \ libicu \ + cronie \ pgbackrest-${PGBACKREST_VERSION} \ && ${PACKAGER} -y clean all ; \ fi +RUN ETCDVERSION=3.5.13 \ +&& echo "https://github.com/coreos/etcd/releases/download/v${ETCDVERSION}/etcd-v${ETCDVERSION}-linux-${ARCH}.tar.gz" + # install etcdctl RUN ETCDVERSION=3.5.13 \ && curl -L https://github.com/coreos/etcd/releases/download/v${ETCDVERSION}/etcd-v${ETCDVERSION}-linux-${ARCH}.tar.gz \ @@ -111,6 +116,7 @@ RUN ETCDVERSION=3.5.13 \ ENV PATHBACKUP = $PATH COPY runit-2.1.2.tar.gz /package/runit-2.1.2.tar.gz +COPY cron_unprivileged.c /package/ # Install pam_oauth2.so #RUN #git clone -b $PAM_OAUTH2 --recurse-submodules https://github.com/zalando-pg/pam-oauth2.git \ @@ -177,6 +183,7 @@ RUN pip3 install 'PyYAML<6.0' setuptools pystache loader kazoo meld3 boto python done \ && ${PACKAGER} -y install --nodocs --noplugins --setopt=install_weak_deps=0 glibc-static \ && ${PACKAGER} -y clean all; + RUN gcc -s -shared -fPIC -o /usr/local/lib/cron_unprivileged.so /package/cron_unprivileged.c RUN cd /package && tar -xvzf runit-2.1.2.tar.gz && rm runit-2.1.2.tar.gz \ && cd admin/runit-2.1.2 && package/install \ @@ -188,6 +195,7 @@ RUN pip3 install 'PyYAML<6.0' setuptools pystache loader kazoo meld3 boto python && ${PACKAGER} -y clean dbcache \ && ${PACKAGER} -y clean all; + # RUN ${PACKAGER} -y install --nodocs --noplugins --setopt=install_weak_deps=0 glibc-devel glibc-static \ # && ${PACKAGER} -y clean all \ # && mkdir -p /package \ diff --git a/runit/cron/run b/runit/cron/run index 73f8e10..110ca8b 100755 --- a/runit/cron/run +++ b/runit/cron/run @@ -5,4 +5,4 @@ if [ "$(id -u)" -ne 0 ]; then fi exec 2>&1 -exec env -i LD_PRELOAD=$LD_PRELOAD /usr/sbin/cron -f +exec env -i LD_PRELOAD=$LD_PRELOAD /usr/sbin/crond -n diff --git a/scripts/configure_spilo.py b/scripts/configure_spilo.py index 0b47eec..9040541 100755 --- a/scripts/configure_spilo.py +++ b/scripts/configure_spilo.py @@ -527,7 +527,8 @@ def get_placeholders(provider): placeholders.setdefault('PGHOME', os.path.expanduser('~')) placeholders.setdefault('APIPORT', '8008') - placeholders.setdefault('BACKUP_SCHEDULE', '0 1 * * *') + placeholders.setdefault('BACKUP_SCHEDULE', '0 1 * * SAT') + placeholders.setdefault('BACKUP_SCHEDULE_INCREMENTAL', '0 1 * * *') placeholders.setdefault('BACKUP_NUM_TO_RETAIN', '5') placeholders.setdefault('CRONTAB', '[]') placeholders.setdefault('PGROOT', os.path.join(placeholders['PGHOME'], 'pgroot')) @@ -959,8 +960,17 @@ def check_crontab(user): def setup_crontab(user, lines): lines += [''] # EOF requires empty line for cron - c = subprocess.Popen(['crontab', '-u', user, '-'], stdin=subprocess.PIPE) - c.communicate(input='\n'.join(lines).encode()) + c = subprocess.Popen(['crontab', '-u', user, '-'], stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE) + stdout, stderr = c.communicate(input='\n'.join(lines).encode()) + if stderr: + return logging.error('Error while adding a crontab: %s', stderr) + +def setup_crontab_postgres(lines): + lines += [''] # EOF requires empty line for cron + c = subprocess.Popen(['crontab','-'], stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE) + stdout, stderr = c.communicate(input='\n'.join(lines).encode()) + if stderr: + return logging.error('Error while adding a crontab for user postgres: %s', stderr) def setup_runit_cron(placeholders): @@ -1006,6 +1016,12 @@ def write_crontab(placeholders, overwrite): hash_dir = os.path.join(placeholders['RW_DIR'], 'tmp') lines += ['*/5 * * * * {0} /scripts/test_reload_ssl.sh {1}'.format(env, hash_dir)] + + if bool(placeholders.get('USE_PGBACKREST')) and not USE_KUBERNETES: + lines += [('{BACKUP_SCHEDULE} /usr/bin/pgbackrest --stanza=db --type=full backup').format(**placeholders)] + lines += [('{BACKUP_SCHEDULE_INCREMENTAL} /usr/bin/pgbackrest --stanza=db --type=incr backup').format(**placeholders)] + + if bool(placeholders.get('USE_WALE')): lines += [('{BACKUP_SCHEDULE} envdir "{WALE_ENV_DIR}" /scripts/postgres_backup.sh' + ' "{PGDATA}"').format(**placeholders)] @@ -1020,7 +1036,7 @@ def write_crontab(placeholders, overwrite): setup_runit_cron(placeholders) if len(lines) > 1 and (overwrite or check_crontab('postgres')): - setup_crontab('postgres', lines) + setup_crontab_postgres(lines) if root_lines and (overwrite or check_crontab('root')): setup_crontab('root', root_lines) diff --git a/scripts/pgbackrest/standalone/pgbackrest.conf b/scripts/pgbackrest/standalone/pgbackrest.conf new file mode 100644 index 0000000..ec0f9cf --- /dev/null +++ b/scripts/pgbackrest/standalone/pgbackrest.conf @@ -0,0 +1,14 @@ +[global] +repo1-cipher-pass=uUQsaa7+CCFaqXVagFzNUix3XuLe9e2uqVskqfI6wcKf8BX8y5b+8bL3oimRpV1N +repo1-cipher-type=aes-256-cbc +repo1-path=/data/pgbackrest/repo1/ +repo1-retention-full=2 +log-level-console=info +log-level-file=debug +log-path = /home/postgres/pgdata/pgbackrest/log +spool-path = /home/postgres/pgdata/pgbackrest/spool-path + +[db] +pg1-path=/home/postgres/pgdata/pgroot/data +pg1-port = 5432 +pg1-socket-path = /var/run/postgresql/ From b8715f787b45cde7c2130240c92facf064f00291 Mon Sep 17 00:00:00 2001 From: Armin Nesiren Date: Fri, 19 Jul 2024 15:19:20 +0200 Subject: [PATCH 2/9] adding restore functionality with pgbackrest --- bootstrap/clone_with_pgbackrest.py | 50 ++++++++++++++++++++++++++++++ scripts/configure_spilo.py | 8 +++++ 2 files changed, 58 insertions(+) create mode 100644 bootstrap/clone_with_pgbackrest.py diff --git a/bootstrap/clone_with_pgbackrest.py b/bootstrap/clone_with_pgbackrest.py new file mode 100644 index 0000000..5c754e6 --- /dev/null +++ b/bootstrap/clone_with_pgbackrest.py @@ -0,0 +1,50 @@ +import argparse +import csv +import logging +import os +import re +import shlex +import subprocess +import sys + +from collections import namedtuple + +logging.basicConfig(format='%(asctime)s %(levelname)s: %(message)s', level=logging.INFO) +logger = logging.getLogger(__name__) + +def read_configuration(): + parser = argparse.ArgumentParser(description="Script to clone using pgbackrest. ") + parser.add_argument('--scope', required=True, help='target cluster name') + parser.add_argument('--datadir', required=True, help='target cluster postgres data directory') + parser.add_argument('--dry-run', action='store_true', help='find a matching backup and build the wal-e ' + 'command to fetch that backup without running it') + args = parser.parse_args() + + options = namedtuple('Options', 'name datadir dry_run') + return options(args.scope, args.datadir, args.dry_run) + +def run_clone_from_pgbackrest(options): + env = os.environ.copy() + + pg_path_argument = "--pg1-path={0}".format(options.datadir) + pgbackrest_command = ['/usr/bin/pgbackrest', '--stanza=db', 'restore', pg_path_argument] + + logger.info("cloning cluster %s using %s", options.name, ' '.join(pgbackrest_command)) + + if not options.dry_run: + ret = subprocess.call(pgbackrest_command, env=env) + if ret != 0: + raise Exception("pgbackrest restore exited with exit code {0}".format(ret)) + + return 0 + +def main(): + options = read_configuration() + try: + run_clone_from_pgbackrest(options) + except Exception: + logger.exception("Clone with pgbackrest failed") + return 1 + +if __name__ == '__main__': + sys.exit(main()) \ No newline at end of file diff --git a/scripts/configure_spilo.py b/scripts/configure_spilo.py index 9040541..6ed66a0 100755 --- a/scripts/configure_spilo.py +++ b/scripts/configure_spilo.py @@ -247,6 +247,13 @@ def deep_update(a, b): recovery_target_inclusive: false {{/CLONE_TARGET_INCLUSIVE}} {{/CLONE_WITH_WALE}} + {{#CLONE_WITH_PGBACKREST}} + method: clone_with_pgbackrest + clone_with_pgbackrest: + command: python3 /scripts/clone_with_pgbackrest.py + recovery_conf: + restore_command: pgbackrest --stanza=db archive-get %f "%p" + {{/CLONE_WITH_PGBACKREST}} {{#CLONE_WITH_BASEBACKUP}} method: clone_with_basebackup clone_with_basebackup: @@ -588,6 +595,7 @@ def get_placeholders(provider): placeholders.setdefault('USE_PAUSE_AT_RECOVERY_TARGET', False) placeholders.setdefault('CLONE_METHOD', '') placeholders.setdefault('CLONE_WITH_WALE', '') + placeholders.setdefault('CLONE_WITH_PGBACKREST', '') placeholders.setdefault('CLONE_WITH_BASEBACKUP', '') placeholders.setdefault('CLONE_TARGET_TIME', '') placeholders.setdefault('CLONE_TARGET_INCLUSIVE', True) From d20e8061bdb48c0c851b5c6ef34248de604c3d9d Mon Sep 17 00:00:00 2001 From: Armin Nesiren Date: Tue, 30 Jul 2024 13:10:38 +0200 Subject: [PATCH 3/9] Handling build without cron --- Makefile | 7 +++++-- docker/postgres/Dockerfile | 3 ++- runit/cron/run | 12 +++++++++++- scripts/configure_spilo.py | 14 ++++++++++---- 4 files changed, 28 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index e184ba2..051c893 100644 --- a/Makefile +++ b/Makefile @@ -17,6 +17,7 @@ BUILD ?= 1 ARCH ?= amd64 IMAGE_TAG ?= $(BASEOS)-$(PGVERSION_FULL)-$(BUILD) POSTGIS_IMAGE_TAG ?= $(BASEOS)-$(PGVERSION_FULL)-$(POSTGIS_VERSION)-$(BUILD) +INSTALL_CRON ?= true # Public-Beta PUBLICBETA ?= 2 @@ -69,6 +70,7 @@ pgbackrest-build: pgbackrest: pgbackrest-build; postgres-build: + docker build $(ROOTPATH) \ --file $(ROOTPATH)/docker/postgres/Dockerfile \ --tag cybertec-pg-container/postgres:$(IMAGE_TAG) \ @@ -82,8 +84,9 @@ postgres-build: --build-arg PGBACKREST_VERSION=$(PGBACKREST_VERSION) \ --build-arg PATRONI_VERSION=$(PATRONI_VERSION) \ --build-arg OLD_PG_VERSIONS="$(OLD_PG_VERSIONS)" \ - --build-arg PGVERSION=$(PGVERSION) \ - --build-arg ARCH=$(ARCH) + --build-arg PGVERSION=$(PGVERSION) \ + --build-arg ARCH=$(ARCH) \ + --build-arg INSTALL_CRON=$(INSTALL_CRON) postgres: postgres-build diff --git a/docker/postgres/Dockerfile b/docker/postgres/Dockerfile index a21fae9..1ce814e 100644 --- a/docker/postgres/Dockerfile +++ b/docker/postgres/Dockerfile @@ -15,6 +15,7 @@ ARG PG_SUPPORTED_VERSIONS="$PGVERSION" ARG PG_SUPPORTED_VERSIONS="$OLD_PG_VERSIONS $PGVERSION" ARG TIMESCALEDB="1.7.5 2.3.1 2.13.0" ARG ARCH +ARG INSTALL_CRON=false # Spilo-specific ENV SET_USER=REL4_0_1 \ @@ -54,8 +55,8 @@ RUN ${PACKAGER} -y update && ${PACKAGER} -y install --nodocs --noplugins --setop rsync \ dumb-init \ libicu \ - cronie \ pgbackrest-${PGBACKREST_VERSION} \ + && if [ "$INSTALL_CRON" = "true" ]; then ${PACKAGER} -y install cronie; fi \ && ${PACKAGER} -y clean all; RUN ETCDVERSION=3.5.13 \ diff --git a/runit/cron/run b/runit/cron/run index 110ca8b..963b108 100755 --- a/runit/cron/run +++ b/runit/cron/run @@ -3,6 +3,16 @@ if [ "$(id -u)" -ne 0 ]; then LD_PRELOAD=/usr/local/lib/cron_unprivileged.so fi +CROND_PATH=/usr/sbin/crond exec 2>&1 -exec env -i LD_PRELOAD=$LD_PRELOAD /usr/sbin/crond -n +# Check if the crond binary exists +if [ -f "$CROND_PATH" ]; then + # Execute the command if the file exists + exec env -i LD_PRELOAD=$LD_PRELOAD $CROND_PATH -n +else + # Print a message or handle the case where the file does not exist + echo "Error: $CROND_PATH does not exist (is cron enabled durring build time?). Command not executed." + sv -w 86400 stop /etc/service/cron + exit 1 +fi diff --git a/scripts/configure_spilo.py b/scripts/configure_spilo.py index d0b3af9..f925ab9 100755 --- a/scripts/configure_spilo.py +++ b/scripts/configure_spilo.py @@ -960,9 +960,12 @@ def write_clone_pgpass(placeholders, overwrite): def check_crontab(user): with open(os.devnull, 'w') as devnull: - cron_exit = subprocess.call(['crontab', '-lu', user], stdout=devnull, stderr=devnull) - if cron_exit == 0: - return logging.warning('Cron for %s is already configured. (Use option --force to overwrite cron)', user) + try: + cron_exit = subprocess.call(['crontab', '-lu', user], stdout=devnull, stderr=devnull) + if cron_exit == 0: + return logging.warning('Cron for %s is already configured. (Use option --force to overwrite cron)', user) + except: + logging.error('We were not able to add cron for user %s. Is cron enabled during build?', user) return True @@ -1044,7 +1047,10 @@ def write_crontab(placeholders, overwrite): setup_runit_cron(placeholders) if len(lines) > 1 and (overwrite or check_crontab('postgres')): - setup_crontab_postgres(lines) + try: + setup_crontab_postgres(lines) + except: + logging.error('Unable to add crontab, is cron as service enabled during build? ') if root_lines and (overwrite or check_crontab('root')): setup_crontab('root', root_lines) From 2cfdbc7debe27225376a54bfa889a1b284e3d42d Mon Sep 17 00:00:00 2001 From: Armin Nesiren Date: Thu, 1 Aug 2024 15:18:57 +0200 Subject: [PATCH 4/9] added option for recovery target time --- bootstrap/clone_with_pgbackrest.py | 25 +++++++++++++++++++------ scripts/configure_spilo.py | 1 + 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/bootstrap/clone_with_pgbackrest.py b/bootstrap/clone_with_pgbackrest.py index 5c754e6..9813c53 100644 --- a/bootstrap/clone_with_pgbackrest.py +++ b/bootstrap/clone_with_pgbackrest.py @@ -1,13 +1,11 @@ import argparse -import csv import logging import os -import re -import shlex import subprocess import sys from collections import namedtuple +from dateutil.parser import parse logging.basicConfig(format='%(asctime)s %(levelname)s: %(message)s', level=logging.INFO) logger = logging.getLogger(__name__) @@ -16,18 +14,33 @@ def read_configuration(): parser = argparse.ArgumentParser(description="Script to clone using pgbackrest. ") parser.add_argument('--scope', required=True, help='target cluster name') parser.add_argument('--datadir', required=True, help='target cluster postgres data directory') + parser.add_argument('--recovery-target-time', + help='the timestamp up to which recovery will proceed (including time zone)', + dest='recovery_target_time_string') parser.add_argument('--dry-run', action='store_true', help='find a matching backup and build the wal-e ' 'command to fetch that backup without running it') args = parser.parse_args() - options = namedtuple('Options', 'name datadir dry_run') - return options(args.scope, args.datadir, args.dry_run) + options = namedtuple('Options', 'name datadir recovery_target_time dry_run') + if args.recovery_target_time_string: + recovery_target_time = parse(args.recovery_target_time_string) + if recovery_target_time.tzinfo is None: + raise Exception("recovery target time must contain a timezone") + else: + recovery_target_time = None + + return options(args.scope, args.datadir, recovery_target_time, args.dry_run) def run_clone_from_pgbackrest(options): env = os.environ.copy() pg_path_argument = "--pg1-path={0}".format(options.datadir) - pgbackrest_command = ['/usr/bin/pgbackrest', '--stanza=db', 'restore', pg_path_argument] + + if options.recovery_target_time: + target_time_argument = "--target={0}".format(options.recovery_target_time) + pgbackrest_command = ['/usr/bin/pgbackrest', '--stanza=db', '--type=time', target_time_argument, 'restore', pg_path_argument] + else: + pgbackrest_command = ['/usr/bin/pgbackrest', '--stanza=db', 'restore', pg_path_argument] logger.info("cloning cluster %s using %s", options.name, ' '.join(pgbackrest_command)) diff --git a/scripts/configure_spilo.py b/scripts/configure_spilo.py index f925ab9..2bf5b6f 100755 --- a/scripts/configure_spilo.py +++ b/scripts/configure_spilo.py @@ -252,6 +252,7 @@ def deep_update(a, b): method: clone_with_pgbackrest clone_with_pgbackrest: command: python3 /scripts/clone_with_pgbackrest.py + --recovery-target-time="{{CLONE_TARGET_TIME}}" recovery_conf: restore_command: pgbackrest --stanza=db archive-get %f "%p" {{/CLONE_WITH_PGBACKREST}} From 9d183e89bc2787e8b53f46446111a4ca24304f5a Mon Sep 17 00:00:00 2001 From: matthias Date: Sat, 16 Nov 2024 11:17:22 +0100 Subject: [PATCH 5/9] remove if-statements for cron --- Makefile | 4 +--- docker/exporter/Dockerfile | 5 ++++- docker/postgres/Dockerfile | 3 +-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 8e8ecb6..f7b70da 100644 --- a/Makefile +++ b/Makefile @@ -18,7 +18,6 @@ BUILD ?= 1 ARCH ?= amd64 IMAGE_TAG ?= $(BASEOS)-$(PGVERSION_FULL)-$(BUILD) POSTGIS_IMAGE_TAG ?= $(BASEOS)-$(PGVERSION_FULL)-$(POSTGIS_VERSION)-$(BUILD) -INSTALL_CRON ?= false # Public-Beta PUBLICBETA ?= 2 @@ -89,8 +88,7 @@ postgres-build: --build-arg PGVERSION=$(PGVERSION) \ --build-arg ETCD_VERSION=$(ETCD_VERSION) \ --build-arg PGVERSION=$(PGVERSION) \ - --build-arg ARCH=$(ARCH) \ - --build-arg INSTALL_CRON=$(INSTALL_CRON) + --build-arg ARCH=$(ARCH) postgres: postgres-build diff --git a/docker/exporter/Dockerfile b/docker/exporter/Dockerfile index 2659a50..903c33b 100644 --- a/docker/exporter/Dockerfile +++ b/docker/exporter/Dockerfile @@ -10,10 +10,13 @@ ARG PACKAGER RUN ${PACKAGER} -y install --nodocs \ --setopt=skip_missing_names_on_install=False \ git \ - go \ dumb-init \ + wget \ + make \ && ${PACKAGER} -y clean all ; +RUN wget https://go.dev/dl/go1.23.0.linux-amd64.tar.gz && tar -xzf go1.23.0.linux-amd64.tar.gz && mv go /usr/local + RUN git clone https://github.com/prometheus-community/postgres_exporter.git && cd postgres_exporter && make build FROM ${CONTAINERIMAGE} diff --git a/docker/postgres/Dockerfile b/docker/postgres/Dockerfile index ec8eae9..3a27ee9 100644 --- a/docker/postgres/Dockerfile +++ b/docker/postgres/Dockerfile @@ -16,7 +16,6 @@ ARG PG_SUPPORTED_VERSIONS="$OLD_PG_VERSIONS $PGVERSION" ARG TIMESCALEDB="1.7.5 2.3.1 2.13.0" ARG ETCD_VERSION ARG ARCH -ARG INSTALL_CRON=false # Spilo-specific ENV SET_USER=REL4_0_1 \ @@ -57,7 +56,7 @@ RUN ${PACKAGER} -y update && ${PACKAGER} -y install --nodocs --noplugins --setop dumb-init \ libicu \ pgbackrest-${PGBACKREST_VERSION} \ - && if [ "$INSTALL_CRON" = "true" ]; then ${PACKAGER} -y install cronie; fi \ + cronie \ && ${PACKAGER} -y clean all; RUN ETCDVERSION=3.5.13 \ From 2c6a94ec116ed3cb5a9343bb9b9ede3b3c87d773 Mon Sep 17 00:00:00 2001 From: matthias Date: Sat, 16 Nov 2024 11:18:07 +0100 Subject: [PATCH 6/9] cleanup --- docker/exporter/Dockerfile | 2 -- 1 file changed, 2 deletions(-) diff --git a/docker/exporter/Dockerfile b/docker/exporter/Dockerfile index 903c33b..23faf48 100644 --- a/docker/exporter/Dockerfile +++ b/docker/exporter/Dockerfile @@ -11,8 +11,6 @@ RUN ${PACKAGER} -y install --nodocs \ --setopt=skip_missing_names_on_install=False \ git \ dumb-init \ - wget \ - make \ && ${PACKAGER} -y clean all ; RUN wget https://go.dev/dl/go1.23.0.linux-amd64.tar.gz && tar -xzf go1.23.0.linux-amd64.tar.gz && mv go /usr/local From 96a42db773d75ae6e39c8ecbe76c6c860be91335 Mon Sep 17 00:00:00 2001 From: matthias Date: Sat, 16 Nov 2024 11:20:55 +0100 Subject: [PATCH 7/9] cleanup --- docker/exporter/Dockerfile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/docker/exporter/Dockerfile b/docker/exporter/Dockerfile index 23faf48..2659a50 100644 --- a/docker/exporter/Dockerfile +++ b/docker/exporter/Dockerfile @@ -10,11 +10,10 @@ ARG PACKAGER RUN ${PACKAGER} -y install --nodocs \ --setopt=skip_missing_names_on_install=False \ git \ + go \ dumb-init \ && ${PACKAGER} -y clean all ; -RUN wget https://go.dev/dl/go1.23.0.linux-amd64.tar.gz && tar -xzf go1.23.0.linux-amd64.tar.gz && mv go /usr/local - RUN git clone https://github.com/prometheus-community/postgres_exporter.git && cd postgres_exporter && make build FROM ${CONTAINERIMAGE} From 108c42a7f183f0abed38d528e263338f69059e1d Mon Sep 17 00:00:00 2001 From: matthias Date: Sat, 16 Nov 2024 11:21:45 +0100 Subject: [PATCH 8/9] remove unneeded file --- scripts/pgbackrest/standalone/pgbackrest.conf | 14 -------------- 1 file changed, 14 deletions(-) delete mode 100644 scripts/pgbackrest/standalone/pgbackrest.conf diff --git a/scripts/pgbackrest/standalone/pgbackrest.conf b/scripts/pgbackrest/standalone/pgbackrest.conf deleted file mode 100644 index ec0f9cf..0000000 --- a/scripts/pgbackrest/standalone/pgbackrest.conf +++ /dev/null @@ -1,14 +0,0 @@ -[global] -repo1-cipher-pass=uUQsaa7+CCFaqXVagFzNUix3XuLe9e2uqVskqfI6wcKf8BX8y5b+8bL3oimRpV1N -repo1-cipher-type=aes-256-cbc -repo1-path=/data/pgbackrest/repo1/ -repo1-retention-full=2 -log-level-console=info -log-level-file=debug -log-path = /home/postgres/pgdata/pgbackrest/log -spool-path = /home/postgres/pgdata/pgbackrest/spool-path - -[db] -pg1-path=/home/postgres/pgdata/pgroot/data -pg1-port = 5432 -pg1-socket-path = /var/run/postgresql/ From 489fbf391b507e4cf0babd059e49ba5dd80f9c2d Mon Sep 17 00:00:00 2001 From: matthias Date: Sat, 16 Nov 2024 11:24:02 +0100 Subject: [PATCH 9/9] remove wrong etcd-install --- docker/postgres/Dockerfile | 3 --- 1 file changed, 3 deletions(-) diff --git a/docker/postgres/Dockerfile b/docker/postgres/Dockerfile index 3a27ee9..cbdf0fb 100644 --- a/docker/postgres/Dockerfile +++ b/docker/postgres/Dockerfile @@ -59,9 +59,6 @@ RUN ${PACKAGER} -y update && ${PACKAGER} -y install --nodocs --noplugins --setop cronie \ && ${PACKAGER} -y clean all; -RUN ETCDVERSION=3.5.13 \ -&& echo "https://github.com/coreos/etcd/releases/download/v${ETCDVERSION}/etcd-v${ETCDVERSION}-linux-${ARCH}.tar.gz" - # install etcdctl RUN curl -L https://github.com/coreos/etcd/releases/download/v${ETCD_VERSION}/etcd-v${ETCD_VERSION}-linux-${ARCH}.tar.gz | tar xz -C /bin --strip=1 --wildcards --no-anchored --no-same-owner etcdctl etcd;