You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The values 999:999 are identical to the current user/group id assigned
in the containers (tested in postgres:9.4, but should be identical for
all versions), but this guarantees that those values will remain the
same even if the groupadd/useradd commands were moved elsewhere in the
Dockerfile, or a new debian:jessie image was pushed.
Tested:
core@test-1 ~ $ docker run -v $(pwd):/origin --rm -it debian:jessie bash -c 'groupadd -r postgres --gid=999 && useradd -r -g postgres --uid=999 postgres && mkdir /origin/pg && chown -R postgres:postgres /origin/pg'
core@test-1 ~ $ ls -hsal pg/
total 8.0K
4.0K drwxr-xr-x 2 999 999 4.0K Sep 22 12:57 .
4.0K drwxr-xr-x 5 core core 4.0K Sep 22 12:59 ..
core@test-1 ~ $ rm -rf pg/
core@test-1 ~ $ docker run -v $(pwd):/origin --rm -it --user=root postgres:9.4 bash -c 'mkdir /origin/pg && chown -R postgres:postgres /origin/pg'
core@test-1 ~ $ ls -hsal pg/
total 8.0K
4.0K drwxr-xr-x 2 999 999 4.0K Sep 22 12:59 .
4.0K drwxr-xr-x 5 core core 4.0K Sep 22 12:59 ..
0 commit comments