You've already forked postgres
mirror of
https://github.com/docker-library/postgres.git
synced 2025-07-28 10:42:06 +03:00
Adjust "/var/run/postgresql" permissions for arbitrary-user support
This commit is contained in:
@ -54,7 +54,7 @@ RUN mv -v /usr/share/postgresql/$PG_MAJOR/postgresql.conf.sample /usr/share/post
|
||||
&& ln -sv ../postgresql.conf.sample /usr/share/postgresql/$PG_MAJOR/ \
|
||||
&& sed -ri "s!^#?(listen_addresses)\s*=\s*\S+.*!\1 = '*'!" /usr/share/postgresql/postgresql.conf.sample
|
||||
|
||||
RUN mkdir -p /var/run/postgresql && chown -R postgres:postgres /var/run/postgresql && chmod g+s /var/run/postgresql
|
||||
RUN mkdir -p /var/run/postgresql && chown -R postgres:postgres /var/run/postgresql && chmod 2777 /var/run/postgresql
|
||||
|
||||
ENV PATH /usr/lib/postgresql/$PG_MAJOR/bin:$PATH
|
||||
ENV PGDATA /var/lib/postgresql/data
|
||||
|
@ -161,7 +161,7 @@ RUN set -ex \
|
||||
# make the sample config easier to munge (and "correct by default")
|
||||
RUN sed -ri "s!^#?(listen_addresses)\s*=\s*\S+.*!\1 = '*'!" /usr/local/share/postgresql/postgresql.conf.sample
|
||||
|
||||
RUN mkdir -p /var/run/postgresql && chown -R postgres:postgres /var/run/postgresql && chmod g+s /var/run/postgresql
|
||||
RUN mkdir -p /var/run/postgresql && chown -R postgres:postgres /var/run/postgresql && chmod 2777 /var/run/postgresql
|
||||
|
||||
ENV PATH /usr/lib/postgresql/$PG_MAJOR/bin:$PATH
|
||||
ENV PGDATA /var/lib/postgresql/data
|
||||
|
@ -35,7 +35,7 @@ if [ "$1" = 'postgres' ] && [ "$(id -u)" = '0' ]; then
|
||||
|
||||
mkdir -p /var/run/postgresql
|
||||
chown -R postgres /var/run/postgresql
|
||||
chmod g+s /var/run/postgresql
|
||||
chmod 775 /var/run/postgresql
|
||||
|
||||
# Create the transaction log directory before initdb is run (below) so the directory is owned by the correct user
|
||||
if [ "$POSTGRES_INITDB_XLOGDIR" ]; then
|
||||
|
@ -35,7 +35,7 @@ if [ "$1" = 'postgres' ] && [ "$(id -u)" = '0' ]; then
|
||||
|
||||
mkdir -p /var/run/postgresql
|
||||
chown -R postgres /var/run/postgresql
|
||||
chmod g+s /var/run/postgresql
|
||||
chmod 775 /var/run/postgresql
|
||||
|
||||
# Create the transaction log directory before initdb is run (below) so the directory is owned by the correct user
|
||||
if [ "$POSTGRES_INITDB_XLOGDIR" ]; then
|
||||
|
@ -54,7 +54,7 @@ RUN mv -v /usr/share/postgresql/$PG_MAJOR/postgresql.conf.sample /usr/share/post
|
||||
&& ln -sv ../postgresql.conf.sample /usr/share/postgresql/$PG_MAJOR/ \
|
||||
&& sed -ri "s!^#?(listen_addresses)\s*=\s*\S+.*!\1 = '*'!" /usr/share/postgresql/postgresql.conf.sample
|
||||
|
||||
RUN mkdir -p /var/run/postgresql && chown -R postgres:postgres /var/run/postgresql && chmod g+s /var/run/postgresql
|
||||
RUN mkdir -p /var/run/postgresql && chown -R postgres:postgres /var/run/postgresql && chmod 2777 /var/run/postgresql
|
||||
|
||||
ENV PATH /usr/lib/postgresql/$PG_MAJOR/bin:$PATH
|
||||
ENV PGDATA /var/lib/postgresql/data
|
||||
|
@ -161,7 +161,7 @@ RUN set -ex \
|
||||
# make the sample config easier to munge (and "correct by default")
|
||||
RUN sed -ri "s!^#?(listen_addresses)\s*=\s*\S+.*!\1 = '*'!" /usr/local/share/postgresql/postgresql.conf.sample
|
||||
|
||||
RUN mkdir -p /var/run/postgresql && chown -R postgres:postgres /var/run/postgresql && chmod g+s /var/run/postgresql
|
||||
RUN mkdir -p /var/run/postgresql && chown -R postgres:postgres /var/run/postgresql && chmod 2777 /var/run/postgresql
|
||||
|
||||
ENV PATH /usr/lib/postgresql/$PG_MAJOR/bin:$PATH
|
||||
ENV PGDATA /var/lib/postgresql/data
|
||||
|
@ -35,7 +35,7 @@ if [ "$1" = 'postgres' ] && [ "$(id -u)" = '0' ]; then
|
||||
|
||||
mkdir -p /var/run/postgresql
|
||||
chown -R postgres /var/run/postgresql
|
||||
chmod g+s /var/run/postgresql
|
||||
chmod 775 /var/run/postgresql
|
||||
|
||||
# Create the transaction log directory before initdb is run (below) so the directory is owned by the correct user
|
||||
if [ "$POSTGRES_INITDB_XLOGDIR" ]; then
|
||||
|
@ -35,7 +35,7 @@ if [ "$1" = 'postgres' ] && [ "$(id -u)" = '0' ]; then
|
||||
|
||||
mkdir -p /var/run/postgresql
|
||||
chown -R postgres /var/run/postgresql
|
||||
chmod g+s /var/run/postgresql
|
||||
chmod 775 /var/run/postgresql
|
||||
|
||||
# Create the transaction log directory before initdb is run (below) so the directory is owned by the correct user
|
||||
if [ "$POSTGRES_INITDB_XLOGDIR" ]; then
|
||||
|
@ -54,7 +54,7 @@ RUN mv -v /usr/share/postgresql/$PG_MAJOR/postgresql.conf.sample /usr/share/post
|
||||
&& ln -sv ../postgresql.conf.sample /usr/share/postgresql/$PG_MAJOR/ \
|
||||
&& sed -ri "s!^#?(listen_addresses)\s*=\s*\S+.*!\1 = '*'!" /usr/share/postgresql/postgresql.conf.sample
|
||||
|
||||
RUN mkdir -p /var/run/postgresql && chown -R postgres:postgres /var/run/postgresql && chmod g+s /var/run/postgresql
|
||||
RUN mkdir -p /var/run/postgresql && chown -R postgres:postgres /var/run/postgresql && chmod 2777 /var/run/postgresql
|
||||
|
||||
ENV PATH /usr/lib/postgresql/$PG_MAJOR/bin:$PATH
|
||||
ENV PGDATA /var/lib/postgresql/data
|
||||
|
@ -134,7 +134,7 @@ RUN set -ex \
|
||||
# make the sample config easier to munge (and "correct by default")
|
||||
RUN sed -ri "s!^#?(listen_addresses)\s*=\s*\S+.*!\1 = '*'!" /usr/local/share/postgresql/postgresql.conf.sample
|
||||
|
||||
RUN mkdir -p /var/run/postgresql && chown -R postgres:postgres /var/run/postgresql && chmod g+s /var/run/postgresql
|
||||
RUN mkdir -p /var/run/postgresql && chown -R postgres:postgres /var/run/postgresql && chmod 2777 /var/run/postgresql
|
||||
|
||||
ENV PATH /usr/lib/postgresql/$PG_MAJOR/bin:$PATH
|
||||
ENV PGDATA /var/lib/postgresql/data
|
||||
|
@ -35,7 +35,7 @@ if [ "$1" = 'postgres' ] && [ "$(id -u)" = '0' ]; then
|
||||
|
||||
mkdir -p /var/run/postgresql
|
||||
chown -R postgres /var/run/postgresql
|
||||
chmod g+s /var/run/postgresql
|
||||
chmod 775 /var/run/postgresql
|
||||
|
||||
# Create the transaction log directory before initdb is run (below) so the directory is owned by the correct user
|
||||
if [ "$POSTGRES_INITDB_XLOGDIR" ]; then
|
||||
|
@ -35,7 +35,7 @@ if [ "$1" = 'postgres' ] && [ "$(id -u)" = '0' ]; then
|
||||
|
||||
mkdir -p /var/run/postgresql
|
||||
chown -R postgres /var/run/postgresql
|
||||
chmod g+s /var/run/postgresql
|
||||
chmod 775 /var/run/postgresql
|
||||
|
||||
# Create the transaction log directory before initdb is run (below) so the directory is owned by the correct user
|
||||
if [ "$POSTGRES_INITDB_XLOGDIR" ]; then
|
||||
|
@ -54,7 +54,7 @@ RUN mv -v /usr/share/postgresql/$PG_MAJOR/postgresql.conf.sample /usr/share/post
|
||||
&& ln -sv ../postgresql.conf.sample /usr/share/postgresql/$PG_MAJOR/ \
|
||||
&& sed -ri "s!^#?(listen_addresses)\s*=\s*\S+.*!\1 = '*'!" /usr/share/postgresql/postgresql.conf.sample
|
||||
|
||||
RUN mkdir -p /var/run/postgresql && chown -R postgres:postgres /var/run/postgresql && chmod g+s /var/run/postgresql
|
||||
RUN mkdir -p /var/run/postgresql && chown -R postgres:postgres /var/run/postgresql && chmod 2777 /var/run/postgresql
|
||||
|
||||
ENV PATH /usr/lib/postgresql/$PG_MAJOR/bin:$PATH
|
||||
ENV PGDATA /var/lib/postgresql/data
|
||||
|
@ -134,7 +134,7 @@ RUN set -ex \
|
||||
# make the sample config easier to munge (and "correct by default")
|
||||
RUN sed -ri "s!^#?(listen_addresses)\s*=\s*\S+.*!\1 = '*'!" /usr/local/share/postgresql/postgresql.conf.sample
|
||||
|
||||
RUN mkdir -p /var/run/postgresql && chown -R postgres:postgres /var/run/postgresql && chmod g+s /var/run/postgresql
|
||||
RUN mkdir -p /var/run/postgresql && chown -R postgres:postgres /var/run/postgresql && chmod 2777 /var/run/postgresql
|
||||
|
||||
ENV PATH /usr/lib/postgresql/$PG_MAJOR/bin:$PATH
|
||||
ENV PGDATA /var/lib/postgresql/data
|
||||
|
@ -35,7 +35,7 @@ if [ "$1" = 'postgres' ] && [ "$(id -u)" = '0' ]; then
|
||||
|
||||
mkdir -p /var/run/postgresql
|
||||
chown -R postgres /var/run/postgresql
|
||||
chmod g+s /var/run/postgresql
|
||||
chmod 775 /var/run/postgresql
|
||||
|
||||
# Create the transaction log directory before initdb is run (below) so the directory is owned by the correct user
|
||||
if [ "$POSTGRES_INITDB_XLOGDIR" ]; then
|
||||
|
@ -35,7 +35,7 @@ if [ "$1" = 'postgres' ] && [ "$(id -u)" = '0' ]; then
|
||||
|
||||
mkdir -p /var/run/postgresql
|
||||
chown -R postgres /var/run/postgresql
|
||||
chmod g+s /var/run/postgresql
|
||||
chmod 775 /var/run/postgresql
|
||||
|
||||
# Create the transaction log directory before initdb is run (below) so the directory is owned by the correct user
|
||||
if [ "$POSTGRES_INITDB_XLOGDIR" ]; then
|
||||
|
@ -54,7 +54,7 @@ RUN mv -v /usr/share/postgresql/$PG_MAJOR/postgresql.conf.sample /usr/share/post
|
||||
&& ln -sv ../postgresql.conf.sample /usr/share/postgresql/$PG_MAJOR/ \
|
||||
&& sed -ri "s!^#?(listen_addresses)\s*=\s*\S+.*!\1 = '*'!" /usr/share/postgresql/postgresql.conf.sample
|
||||
|
||||
RUN mkdir -p /var/run/postgresql && chown -R postgres:postgres /var/run/postgresql && chmod g+s /var/run/postgresql
|
||||
RUN mkdir -p /var/run/postgresql && chown -R postgres:postgres /var/run/postgresql && chmod 2777 /var/run/postgresql
|
||||
|
||||
ENV PATH /usr/lib/postgresql/$PG_MAJOR/bin:$PATH
|
||||
ENV PGDATA /var/lib/postgresql/data
|
||||
|
@ -134,7 +134,7 @@ RUN set -ex \
|
||||
# make the sample config easier to munge (and "correct by default")
|
||||
RUN sed -ri "s!^#?(listen_addresses)\s*=\s*\S+.*!\1 = '*'!" /usr/local/share/postgresql/postgresql.conf.sample
|
||||
|
||||
RUN mkdir -p /var/run/postgresql && chown -R postgres:postgres /var/run/postgresql && chmod g+s /var/run/postgresql
|
||||
RUN mkdir -p /var/run/postgresql && chown -R postgres:postgres /var/run/postgresql && chmod 2777 /var/run/postgresql
|
||||
|
||||
ENV PATH /usr/lib/postgresql/$PG_MAJOR/bin:$PATH
|
||||
ENV PGDATA /var/lib/postgresql/data
|
||||
|
@ -35,7 +35,7 @@ if [ "$1" = 'postgres' ] && [ "$(id -u)" = '0' ]; then
|
||||
|
||||
mkdir -p /var/run/postgresql
|
||||
chown -R postgres /var/run/postgresql
|
||||
chmod g+s /var/run/postgresql
|
||||
chmod 775 /var/run/postgresql
|
||||
|
||||
# Create the transaction log directory before initdb is run (below) so the directory is owned by the correct user
|
||||
if [ "$POSTGRES_INITDB_XLOGDIR" ]; then
|
||||
|
@ -35,7 +35,7 @@ if [ "$1" = 'postgres' ] && [ "$(id -u)" = '0' ]; then
|
||||
|
||||
mkdir -p /var/run/postgresql
|
||||
chown -R postgres /var/run/postgresql
|
||||
chmod g+s /var/run/postgresql
|
||||
chmod 775 /var/run/postgresql
|
||||
|
||||
# Create the transaction log directory before initdb is run (below) so the directory is owned by the correct user
|
||||
if [ "$POSTGRES_INITDB_XLOGDIR" ]; then
|
||||
|
@ -136,7 +136,7 @@ RUN set -ex \
|
||||
# make the sample config easier to munge (and "correct by default")
|
||||
RUN sed -ri "s!^#?(listen_addresses)\s*=\s*\S+.*!\1 = '*'!" /usr/local/share/postgresql/postgresql.conf.sample
|
||||
|
||||
RUN mkdir -p /var/run/postgresql && chown -R postgres:postgres /var/run/postgresql && chmod g+s /var/run/postgresql
|
||||
RUN mkdir -p /var/run/postgresql && chown -R postgres:postgres /var/run/postgresql && chmod 2777 /var/run/postgresql
|
||||
|
||||
ENV PATH /usr/lib/postgresql/$PG_MAJOR/bin:$PATH
|
||||
ENV PGDATA /var/lib/postgresql/data
|
||||
|
@ -54,7 +54,7 @@ RUN mv -v /usr/share/postgresql/$PG_MAJOR/postgresql.conf.sample /usr/share/post
|
||||
&& ln -sv ../postgresql.conf.sample /usr/share/postgresql/$PG_MAJOR/ \
|
||||
&& sed -ri "s!^#?(listen_addresses)\s*=\s*\S+.*!\1 = '*'!" /usr/share/postgresql/postgresql.conf.sample
|
||||
|
||||
RUN mkdir -p /var/run/postgresql && chown -R postgres:postgres /var/run/postgresql && chmod g+s /var/run/postgresql
|
||||
RUN mkdir -p /var/run/postgresql && chown -R postgres:postgres /var/run/postgresql && chmod 2777 /var/run/postgresql
|
||||
|
||||
ENV PATH /usr/lib/postgresql/$PG_MAJOR/bin:$PATH
|
||||
ENV PGDATA /var/lib/postgresql/data
|
||||
|
@ -35,7 +35,7 @@ if [ "$1" = 'postgres' ] && [ "$(id -u)" = '0' ]; then
|
||||
|
||||
mkdir -p /var/run/postgresql
|
||||
chown -R postgres /var/run/postgresql
|
||||
chmod g+s /var/run/postgresql
|
||||
chmod 775 /var/run/postgresql
|
||||
|
||||
# Create the transaction log directory before initdb is run (below) so the directory is owned by the correct user
|
||||
if [ "$POSTGRES_INITDB_XLOGDIR" ]; then
|
||||
|
12
update.sh
12
update.sh
@ -46,8 +46,10 @@ for version in "${versions[@]}"; do
|
||||
case "$version" in
|
||||
9.2|9.3)
|
||||
uuidConfigFlag='--with-ossp-uuid'
|
||||
sed -i 's/%%OSSP_UUID_ENV_VARS%%/ENV OSSP_UUID_VERSION '"$osspUuidVersion"'\nENV OSSP_UUID_SHA256 '"$osspUuidHash"'\n/' "$version/$variant/Dockerfile"
|
||||
sed -i $'/%%INSTALL_OSSP_UUID%%/ {r ossp-uuid.template\n d}' "$version/$variant/Dockerfile"
|
||||
sed -i \
|
||||
-e 's/%%OSSP_UUID_ENV_VARS%%/ENV OSSP_UUID_VERSION '"$osspUuidVersion"'\nENV OSSP_UUID_SHA256 '"$osspUuidHash"'\n/' \
|
||||
-e $'/%%INSTALL_OSSP_UUID%%/ {r ossp-uuid.template\n d}' \
|
||||
"$version/$variant/Dockerfile"
|
||||
|
||||
# configure: WARNING: unrecognized options: --enable-tap-tests
|
||||
sed -i '/--enable-tap-tests/d' "$version/$variant/Dockerfile"
|
||||
@ -55,8 +57,10 @@ for version in "${versions[@]}"; do
|
||||
|
||||
*)
|
||||
uuidConfigFlag='--with-uuid=e2fs'
|
||||
sed -i '/%%OSSP_UUID_ENV_VARS%%/d' "$version/$variant/Dockerfile"
|
||||
sed -i '/%%INSTALL_OSSP_UUID%%/d' "$version/$variant/Dockerfile"
|
||||
sed -i \
|
||||
-e '/%%OSSP_UUID_ENV_VARS%%/d' \
|
||||
-e '/%%INSTALL_OSSP_UUID%%/d' \
|
||||
"$version/$variant/Dockerfile"
|
||||
;;
|
||||
esac
|
||||
sed -i 's/%%UUID_CONFIG_FLAG%%/'"$uuidConfigFlag"'/' "$version/$variant/Dockerfile"
|
||||
|
Reference in New Issue
Block a user