From 051f202fdfbe3f067fa19f6c26c0e728c07be650 Mon Sep 17 00:00:00 2001 From: Simon L Date: Thu, 15 Jun 2023 15:42:26 +0200 Subject: [PATCH] fix postgres build Signed-off-by: Simon L --- Containers/postgresql/Dockerfile | 4 ---- Containers/postgresql/start.sh | 5 +++++ 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Containers/postgresql/Dockerfile b/Containers/postgresql/Dockerfile index ee5dd70a..51590246 100644 --- a/Containers/postgresql/Dockerfile +++ b/Containers/postgresql/Dockerfile @@ -27,10 +27,6 @@ RUN set -ex; \ mkdir /mnt/data; \ chown postgres:postgres /mnt/data; \ \ -# Modify conf - grep -q "#log_checkpoints" /var/lib/postgresql/data/postgresql.conf; \ - sed -i 's|#log_checkpoints.*|log_checkpoints = off|' /var/lib/postgresql/data/postgresql.conf; \ - \ # Give root a random password echo "root:$(openssl rand -base64 12)" | chpasswd; \ apk --no-cache del openssl; diff --git a/Containers/postgresql/start.sh b/Containers/postgresql/start.sh index 0a88e5cb..8f033b7a 100644 --- a/Containers/postgresql/start.sh +++ b/Containers/postgresql/start.sh @@ -153,6 +153,11 @@ if [ -n "$MAX_CONNECTIONS" ]; then sed -i "s|^max_connections =.*|max_connections = $MAX_CONNECTIONS|" "/var/lib/postgresql/data/postgresql.conf" fi +# Modify conf +if grep -q "#log_checkpoints" /var/lib/postgresql/data/postgresql.conf; then + sed -i 's|#log_checkpoints.*|log_checkpoints = off|' /var/lib/postgresql/data/postgresql.conf +fi + # Catch docker stop attempts trap 'true' SIGINT SIGTERM