Skip to content

Commit

Permalink
Add an explicit note about initdb scripts being run as the "postgres"…
Browse files Browse the repository at this point in the history
… user now
  • Loading branch information
tianon committed Feb 28, 2017
1 parent ea8a5a1 commit 9c8e198
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions postgres/content.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,8 @@ EOSQL

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.

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).

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`:

```dockerfile
Expand Down

0 comments on commit 9c8e198

Please sign in to comment.