From 9c8e198a1e4ce2776243b5890395d2039ea9cd87 Mon Sep 17 00:00:00 2001 From: Tianon Gravi Date: Tue, 28 Feb 2017 09:45:28 -0800 Subject: [PATCH] Add an explicit note about initdb scripts being run as the "postgres" user now --- postgres/content.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/postgres/content.md b/postgres/content.md index 71102c824c49..e7ffa61410b9 100644 --- a/postgres/content.md +++ b/postgres/content.md @@ -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