3232if [ " $1 " = ' postgres' ] && [ " $( id -u) " = ' 0' ]; then
3333 mkdir -p " $PGDATA "
3434 chown -R postgres " $PGDATA "
35- chmod 777 " $PGDATA "
35+ chmod 700 " $PGDATA "
3636
3737 mkdir -p /var/run/postgresql
3838 chown -R postgres /var/run/postgresql
5151if [ " $1 " = ' postgres' ]; then
5252 mkdir -p " $PGDATA "
5353 chown -R " $( id -u) " " $PGDATA " 2> /dev/null || :
54- chmod 777 " $PGDATA " 2> /dev/null || :
54+ chmod 700 " $PGDATA " 2> /dev/null || :
5555
5656 # look specifically for PG_VERSION, as it is expected in the DB dir
5757 if [ ! -s " $PGDATA /PG_VERSION" ]; then
@@ -87,14 +87,10 @@ if [ "$1" = 'postgres' ]; then
8787
8888 if [ " ${# POSTGRES_PASSWORD} " -ge 100 ]; then
8989 cat >&2 << -'EOWARN '
90-
9190 WARNING: The supplied POSTGRES_PASSWORD is 100+ characters.
92-
9391 This will not work if used via PGPASSWORD with "psql".
94-
9592 https://www.postgresql.org/message-id/flat/E1Rqxp2-0004Qt-PL%40wrigleys.postgresql.org (BUG #6412)
9693 https://github.com/docker-library/postgres/issues/507
97-
9894 EOWARN
9995 fi
10096 else
@@ -107,7 +103,6 @@ if [ "$1" = 'postgres' ]; then
107103 Docker's default configuration, this is
108104 effectively any other container on the same
109105 system.
110-
111106 Use "-e POSTGRES_PASSWORD=password" to set
112107 it in "docker run".
113108 ****************************************************
@@ -172,5 +167,5 @@ if [ "$1" = 'postgres' ]; then
172167 echo
173168 fi
174169fi
175- # chmod 777 "$PGDATA" 2>/dev/null
170+
176171exec " $@ "
0 commit comments