Skip to content

Commit 1b0356f

Browse files
committed
Unset bootstrap credentials before exec-ing the server
POSTGRES_PASSWORD (and related vars) are only needed during initdb and the temporary-server initialisation phase. After that they serve no purpose, but remain in the process environment for the entire lifetime of the container, where any loaded C extension can read them via environ. Unsetting them immediately before the final exec ensures the running PostgreSQL server process starts with a clean environment.
1 parent dc8f7ae commit 1b0356f

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

docker-entrypoint.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -379,6 +379,7 @@ _main() {
379379
fi
380380
fi
381381

382+
unset POSTGRES_PASSWORD POSTGRES_USER POSTGRES_DB POSTGRES_INITDB_ARGS
382383
exec "$@"
383384
}
384385

0 commit comments

Comments
 (0)