Skip to content

Commit c816456

Browse files
authored
Merge pull request #848 from infosiftr/postgres-more-user
Add an explicit note about initdb scripts being run as the "postgres" user now
2 parents 88d3061 + 9c8e198 commit c816456

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

postgres/content.md

+2
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,8 @@ EOSQL
126126

127127
These initialization files will be executed in sorted name order as defined by the current locale, which defaults to `en_US.utf8`. Any `*.sql` files will be executed by `POSTGRES_USER`, which defaults to the `postgres` superuser. It is recommended that any `psql` commands that are run inside of a `*.sh` script be executed as `POSTGRES_USER` by using the `--username "$POSTGRES_USER"` flag. This user will be able to connect without a password due to the presence of `trust` authentication for Unix socket connections made inside the container.
128128

129+
Additionally, as of [docker-library/postgres#253](https://github.com/docker-library/postgres/pull/253), these initialization scripts are run as the `postgres` user (or as the "semi-arbitrary user" specified with the `--user` flag to `docker run`; see the section titled "Arbitrary `--user` Notes" for more details).
130+
129131
You can also extend the image with a simple `Dockerfile` to set a different locale. The following example will set the default locale to `de_DE.utf8`:
130132

131133
```dockerfile

0 commit comments

Comments
 (0)