From 74c04d60ec58c85fc7903cfc4698a58658704a53 Mon Sep 17 00:00:00 2001 From: Dominik Kohler Date: Thu, 15 Aug 2024 11:59:24 +0200 Subject: [PATCH 1/2] enable config dir in default config --- Dockerfile-alpine.template | 6 ++++-- Dockerfile-debian.template | 7 ++++--- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/Dockerfile-alpine.template b/Dockerfile-alpine.template index 3d6236e6e8..4726734d32 100644 --- a/Dockerfile-alpine.template +++ b/Dockerfile-alpine.template @@ -203,9 +203,11 @@ RUN set -eux; \ # make the sample config easier to munge (and "correct by default") RUN set -eux; \ - cp -v /usr/local/share/postgresql/postgresql.conf.sample /usr/local/share/postgresql/postgresql.conf.sample.orig; \ + mkdir -p /etc/postgresql/conf.d; \ + mv -v /usr/local/share/postgresql/postgresql.conf.sample /usr/local/share/postgresql/postgresql.conf.sample.orig; \ + awk '/# CONFIG FILE INCLUDES/ {print; getline; print; print "\ninclude_dir = '\''/etc/postgresql/conf.d'\''"; next} 1' /usr/local/share/postgresql/postgresql.conf.sample.orig > /usr/local/share/postgresql/postgresql.conf.sample; \ sed -ri "s!^#?(listen_addresses)\s*=\s*\S+.*!\1 = '*'!" /usr/local/share/postgresql/postgresql.conf.sample; \ - grep -F "listen_addresses = '*'" /usr/local/share/postgresql/postgresql.conf.sample + grep -F "listen_addresses = '*'" /usr/local/share/postgresql/postgresql.conf.samplee RUN install --verbose --directory --owner postgres --group postgres --mode 3777 /var/run/postgresql diff --git a/Dockerfile-debian.template b/Dockerfile-debian.template index 1fa84903ac..a720a19165 100644 --- a/Dockerfile-debian.template +++ b/Dockerfile-debian.template @@ -173,10 +173,11 @@ RUN set -ex; \ # make the sample config easier to munge (and "correct by default") RUN set -eux; \ dpkg-divert --add --rename --divert "/usr/share/postgresql/postgresql.conf.sample.dpkg" "/usr/share/postgresql/$PG_MAJOR/postgresql.conf.sample"; \ - cp -v /usr/share/postgresql/postgresql.conf.sample.dpkg /usr/share/postgresql/postgresql.conf.sample; \ - ln -sv ../postgresql.conf.sample "/usr/share/postgresql/$PG_MAJOR/"; \ + mkdir -p /etc/postgresql/conf.d; \ + awk '/# CONFIG FILE INCLUDES/ {print; getline; print; print "\ninclude_dir = '\''/etc/postgresql/conf.d'\''"; next} 1' /usr/share/postgresql/postgresql.conf.sample.dpkg > /usr/share/postgresql/postgresql.conf.sample; \ sed -ri "s!^#?(listen_addresses)\s*=\s*\S+.*!\1 = '*'!" /usr/share/postgresql/postgresql.conf.sample; \ - grep -F "listen_addresses = '*'" /usr/share/postgresql/postgresql.conf.sample + grep -F "listen_addresses = '*'" /usr/share/postgresql/postgresql.conf.sample; \ + ln -sv ../postgresql.conf.sample "/usr/share/postgresql/$PG_MAJOR/"; RUN install --verbose --directory --owner postgres --group postgres --mode 3777 /var/run/postgresql From fa396e95097a5dc0c4059940b1295d81fd2071b9 Mon Sep 17 00:00:00 2001 From: Dominik Kohler <18621527+kohlerdominik@users.noreply.github.com> Date: Fri, 30 Aug 2024 21:47:10 +0200 Subject: [PATCH 2/2] fixed typo --- Dockerfile-alpine.template | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile-alpine.template b/Dockerfile-alpine.template index 4726734d32..3bcc57159e 100644 --- a/Dockerfile-alpine.template +++ b/Dockerfile-alpine.template @@ -207,7 +207,7 @@ RUN set -eux; \ mv -v /usr/local/share/postgresql/postgresql.conf.sample /usr/local/share/postgresql/postgresql.conf.sample.orig; \ awk '/# CONFIG FILE INCLUDES/ {print; getline; print; print "\ninclude_dir = '\''/etc/postgresql/conf.d'\''"; next} 1' /usr/local/share/postgresql/postgresql.conf.sample.orig > /usr/local/share/postgresql/postgresql.conf.sample; \ sed -ri "s!^#?(listen_addresses)\s*=\s*\S+.*!\1 = '*'!" /usr/local/share/postgresql/postgresql.conf.sample; \ - grep -F "listen_addresses = '*'" /usr/local/share/postgresql/postgresql.conf.samplee + grep -F "listen_addresses = '*'" /usr/local/share/postgresql/postgresql.conf.sample RUN install --verbose --directory --owner postgres --group postgres --mode 3777 /var/run/postgresql