8000 Merge pull request #209 from infosiftr/always-be-postgres-user · raszi/postgres@b7929a5 · GitHub
[go: up one dir, main page]

Skip to content

Commit b7929a5

Browse files
authored
Merge pull request docker-library#209 from infosiftr/always-be-postgres-user
Use gosu postgres when writing to hba.cnf so that drop-cap dac_override works
2 parents 461b6db + 2a95274 commit b7929a5

File tree

7 files changed

+7
-7
lines changed

7 files changed

+7
-7
lines changed

9.1/docker-entrypoint.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ if [ "$1" = 'postgres' ]; then
4343
authMethod=trust
4444
fi
4545

46-
{ echo; echo "host all all 0.0.0.0/0 $authMethod"; } >> "$PGDATA/pg_hba.conf"
46+
{ echo; echo "host all all 0.0.0.0/0 $authMethod"; } | gosu postgres tee -a "$PGDATA/pg_hba.conf" > /dev/null
4747

4848
# internal start of server in order to allow set-up using psql-client
4949
# does not listen on external TCP/IP and waits until start finishes

9.2/docker-entrypoint.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ if [ "$1" = 'postgres' ]; then
4343
authMethod=trust
4444
fi
4545

46-
{ echo; echo "host all all 0.0.0.0/0 $authMethod"; } >> "$PGDATA/pg_hba.conf"
46+
{ echo; echo "host all all 0.0.0.0/0 $authMethod"; } | gosu postgres tee -a "$PGDATA/pg_hba.conf" > /dev/null
4747

4848
# internal start of server in order to allow set-up using psql-client
4949
# does not listen on external TCP/IP and waits until start finishes

9.3/docker-entrypoint.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ if [ "$1" = 'postgres' ]; then
4343
authMethod=trust
4444
fi
4545

46-
{ echo; echo "host all all 0.0.0.0/0 $authMethod"; } >> "$PGDATA/pg_hba.conf"
46+
{ echo; echo "host all all 0.0.0.0/0 $authMethod"; } | gosu postgres tee -a "$PGDATA/pg_hba.conf" > /dev/null
4747

4848
# internal start of server in order to allow set-up using psql-client
4949
# does not listen on external TCP/IP and waits until start finishes

9.4/docker-entrypoint.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ if [ "$1" = 'postgres' ]; then
4343
authMethod=trust
4444
fi
4545

46-
{ echo; echo "host all all 0.0.0.0/0 $authMethod"; } >> "$PGDATA/pg_hba.conf"
46+
{ echo; echo "host all all 0.0.0.0/0 $authMethod"; } | gosu postgres tee -a "$PGDATA/pg_hba.conf" > /dev/null
4747

4848
# internal start of server in order to allow set-up using psql-client
4949
# does not listen on external TCP/IP and waits until start finishes

9.5/docker-entrypoint.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ if [ "$1" = 'postgres' ]; then
4343
authMethod=trust
4444
fi
4545

46-
{ echo; echo "host all all 0.0.0.0/0 $authMethod"; } >> "$PGDATA/pg_hba.conf"
46+
{ echo; echo "host all all 0.0.0.0/0 $authMethod"; } | gosu postgres tee -a "$PGDATA/pg_hba.conf" > /dev/null
4747

4848
# internal start of server in order to allow set-up using psql-client
4949
# does not listen on external TCP/IP and waits until start finishes

9.6/docker-entrypoint.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ if [ "$1" = 'postgres' ]; then
4343
authMethod=trust
4444
fi
4545

46-
{ echo; echo "host all all 0.0.0.0/0 $authMethod"; } >> "$PGDATA/pg_hba.conf"
46+
{ echo; echo "host all all 0.0.0.0/0 $authMethod"; } | gosu postgres tee -a "$PGDATA/pg_hba.conf" > /dev/null
4747

4848
# internal start of server in order to allow set-up using psql-client
4949
# does not listen on external TCP/IP and waits until start finishes

docker-entrypoint.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ if [ "$1" = 'postgres' ]; then
4343
authMethod=trust
4444
fi
4545

46-
{ echo; echo "host all all 0.0.0.0/0 $authMethod"; } >> "$PGDATA/pg_hba.conf"
46+
{ echo; echo "host all all 0.0.0.0/0 $authMethod"; } | gosu postgres tee -a "$PGDATA/pg_hba.conf" > /dev/null
4747

4848
# internal start of server in order to allow set-up using psql-client
4949
# does not listen on external TCP/IP and waits until start finishes

0 commit comments

Comments
 (0)
0