Fix Debian "postgres" user HOME (to match Debian package)

See 997d842ee7/debian/postgresql-common.postinst (L32-35) for the bit of the upstream Debian package which sets this.
This commit is contained in:
Tianon Gravi 2018-08-17 13:00:10 -07:00
parent 9986244c45
commit 726128b358
7 changed files with 56 additions and 7 deletions

View File

@ -12,7 +12,14 @@ RUN set -ex; \
fi fi
# explicitly set user/group IDs # explicitly set user/group IDs
RUN groupadd -r postgres --gid=999 && useradd -r -g postgres --uid=999 postgres RUN set -eux; \
groupadd -r postgres --gid=999; \
# https://salsa.debian.org/postgresql/postgresql-common/blob/997d842ee744687d99a2b2d95c1083a2615c79e8/debian/postgresql-common.postinst#L32-35
useradd -r -g postgres --uid=999 --home-dir=/var/lib/postgresql --shell=/bin/bash postgres; \
# also create the postgres user's home directory with appropriate permissions
# see https://github.com/docker-library/postgres/issues/274
mkdir -p /var/lib/postgresql; \
chown -R postgres:postgres /var/lib/postgresql
# grab gosu for easy step-down from root # grab gosu for easy step-down from root
ENV GOSU_VERSION 1.10 ENV GOSU_VERSION 1.10

View File

@ -12,7 +12,14 @@ RUN set -ex; \
fi fi
# explicitly set user/group IDs # explicitly set user/group IDs
RUN groupadd -r postgres --gid=999 && useradd -r -g postgres --uid=999 postgres RUN set -eux; \
groupadd -r postgres --gid=999; \
# https://salsa.debian.org/postgresql/postgresql-common/blob/997d842ee744687d99a2b2d95c1083a2615c79e8/debian/postgresql-common.postinst#L32-35
useradd -r -g postgres --uid=999 --home-dir=/var/lib/postgresql --shell=/bin/bash postgres; \
# also create the postgres user's home directory with appropriate permissions
# see https://github.com/docker-library/postgres/issues/274
mkdir -p /var/lib/postgresql; \
chown -R postgres:postgres /var/lib/postgresql
# grab gosu for easy step-down from root # grab gosu for easy step-down from root
ENV GOSU_VERSION 1.10 ENV GOSU_VERSION 1.10

View File

@ -12,7 +12,14 @@ RUN set -ex; \
fi fi
# explicitly set user/group IDs # explicitly set user/group IDs
RUN groupadd -r postgres --gid=999 && useradd -r -g postgres --uid=999 postgres RUN set -eux; \
groupadd -r postgres --gid=999; \
# https://salsa.debian.org/postgresql/postgresql-common/blob/997d842ee744687d99a2b2d95c1083a2615c79e8/debian/postgresql-common.postinst#L32-35
useradd -r -g postgres --uid=999 --home-dir=/var/lib/postgresql --shell=/bin/bash postgres; \
# also create the postgres user's home directory with appropriate permissions
# see https://github.com/docker-library/postgres/issues/274
mkdir -p /var/lib/postgresql; \
chown -R postgres:postgres /var/lib/postgresql
# grab gosu for easy step-down from root # grab gosu for easy step-down from root
ENV GOSU_VERSION 1.10 ENV GOSU_VERSION 1.10

View File

@ -12,7 +12,14 @@ RUN set -ex; \
fi fi
# explicitly set user/group IDs # explicitly set user/group IDs
RUN groupadd -r postgres --gid=999 && useradd -r -g postgres --uid=999 postgres RUN set -eux; \
groupadd -r postgres --gid=999; \
# https://salsa.debian.org/postgresql/postgresql-common/blob/997d842ee744687d99a2b2d95c1083a2615c79e8/debian/postgresql-common.postinst#L32-35
useradd -r -g postgres --uid=999 --home-dir=/var/lib/postgresql --shell=/bin/bash postgres; \
# also create the postgres user's home directory with appropriate permissions
# see https://github.com/docker-library/postgres/issues/274
mkdir -p /var/lib/postgresql; \
chown -R postgres:postgres /var/lib/postgresql
# grab gosu for easy step-down from root # grab gosu for easy step-down from root
ENV GOSU_VERSION 1.10 ENV GOSU_VERSION 1.10

View File

@ -12,7 +12,14 @@ RUN set -ex; \
fi fi
# explicitly set user/group IDs # explicitly set user/group IDs
RUN groupadd -r postgres --gid=999 && useradd -r -g postgres --uid=999 postgres RUN set -eux; \
groupadd -r postgres --gid=999; \
# https://salsa.debian.org/postgresql/postgresql-common/blob/997d842ee744687d99a2b2d95c1083a2615c79e8/debian/postgresql-common.postinst#L32-35
useradd -r -g postgres --uid=999 --home-dir=/var/lib/postgresql --shell=/bin/bash postgres; \
# also create the postgres user's home directory with appropriate permissions
# see https://github.com/docker-library/postgres/issues/274
mkdir -p /var/lib/postgresql; \
chown -R postgres:postgres /var/lib/postgresql
# grab gosu for easy step-down from root # grab gosu for easy step-down from root
ENV GOSU_VERSION 1.10 ENV GOSU_VERSION 1.10

View File

@ -12,7 +12,14 @@ RUN set -ex; \
fi fi
# explicitly set user/group IDs # explicitly set user/group IDs
RUN groupadd -r postgres --gid=999 && useradd -r -g postgres --uid=999 postgres RUN set -eux; \
groupadd -r postgres --gid=999; \
# https://salsa.debian.org/postgresql/postgresql-common/blob/997d842ee744687d99a2b2d95c1083a2615c79e8/debian/postgresql-common.postinst#L32-35
useradd -r -g postgres --uid=999 --home-dir=/var/lib/postgresql --shell=/bin/bash postgres; \
# also create the postgres user's home directory with appropriate permissions
# see https://github.com/docker-library/postgres/issues/274
mkdir -p /var/lib/postgresql; \
chown -R postgres:postgres /var/lib/postgresql
# grab gosu for easy step-down from root # grab gosu for easy step-down from root
ENV GOSU_VERSION 1.10 ENV GOSU_VERSION 1.10

View File

@ -12,7 +12,14 @@ RUN set -ex; \
fi fi
# explicitly set user/group IDs # explicitly set user/group IDs
RUN groupadd -r postgres --gid=999 && useradd -r -g postgres --uid=999 postgres RUN set -eux; \
groupadd -r postgres --gid=999; \
# https://salsa.debian.org/postgresql/postgresql-common/blob/997d842ee744687d99a2b2d95c1083a2615c79e8/debian/postgresql-common.postinst#L32-35
useradd -r -g postgres --uid=999 --home-dir=/var/lib/postgresql --shell=/bin/bash postgres; \
# also create the postgres user's home directory with appropriate permissions
# see https://github.com/docker-library/postgres/issues/274
mkdir -p /var/lib/postgresql; \
chown -R postgres:postgres /var/lib/postgresql
# grab gosu for easy step-down from root # grab gosu for easy step-down from root
ENV GOSU_VERSION 1.10 ENV GOSU_VERSION 1.10