Skip to content

Commit 621c86f

Browse files
authored
Merge pull request #1239 from infosiftr/pg-nss-wrapper
Update postgres "arbitrary user" notes to reference new nss_wrapper functionality
2 parents 97f35af + 8b29e07 commit 621c86f

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

postgres/content.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,17 +106,19 @@ $ docker run -it --rm --user 1000:1000 %%IMAGE%%
106106
initdb: could not look up effective user ID 1000: user does not exist
107107
```
108108

109-
The two easiest ways to get around this:
109+
The three easiest ways to get around this:
110110

111-
1. bind-mount `/etc/passwd` read-only from the host (if the UID you desire is a valid user on your host):
111+
1. use the Debian variants (not the Alpine variants) and thus allow the image to use [the `nss_wrapper` library](https://cwrap.org/nss_wrapper.html) to "fake" `/etc/passwd` contents for you (see [docker-library/postgres#448](https://github.com/docker-library/postgres/pull/448) for more details)
112+
113+
2. bind-mount `/etc/passwd` read-only from the host (if the UID you desire is a valid user on your host):
112114

113115
```console
114116
$ docker run -it --rm --user "$(id -u):$(id -g)" -v /etc/passwd:/etc/passwd:ro %%IMAGE%%
115117
The files belonging to this database system will be owned by user "jsmith".
116118
...
117119
```
118120

119-
2. initialize the target directory separately from the final runtime (with a `chown` in between):
121+
3. initialize the target directory separately from the final runtime (with a `chown` in between):
120122

121123
```console
122124
$ docker volume create pgdata

0 commit comments

Comments
 (0)