Skip to content

Commit

Permalink
ROX-19980 fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ludydoo committed Oct 27, 2023
1 parent 97cd483 commit 906063a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion image/db/rhel/Dockerfile.slim
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ RUN curl -sSLf https://download.postgresql.org/pub/repos/yum/RPM-GPG-KEY-PGDG-${
groupadd -g 70 postgres && \
adduser postgres -u 70 -g 70 -d /var/lib/postgresql -s /bin/sh && \
microdnf install \
ca-certificates libicu systemd-sysv glibc-locale-source glibc-langpack-en \
ca-certificates tar libicu systemd-sysv glibc-locale-source glibc-langpack-en \
postgresql12-server && \
# The removal of /usr/share/zoneinfo from UBI minimal images is intentional.
# After building the image, the image is reduced in size as much as possible,
Expand Down
6 changes: 5 additions & 1 deletion image/db/rhel/scripts/custom-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,11 @@ if [ ! -d "/var/lib/postgresql/data/pgdata" ]; then
echo "Renaming postgres user if necessary..."
if [ -n "$POSTGRES_USER" ]; then
if [ "$POSTGRES_USER" != "postgres" ]; then
PGPASSWORD="$POSTGRES_PASSWORD" psql -c "ALTER USER postgres RENAME TO $POSTGRES_USER;"
if [ -n "$POSTGRES_PASSWORD" ]; then
PGPASSWORD="$POSTGRES_PASSWORD" psql -c "ALTER USER postgres RENAME TO $POSTGRES_USER;"
elif [ -n "$POSTGRES_PASSWORD_FILE" ]; then
PGPASSWORD="$(cat "$POSTGRES_PASSWORD_FILE")" psql -c "ALTER USER postgres RENAME TO $POSTGRES_USER;"
fi
fi
fi

Expand Down

0 comments on commit 906063a

Please sign in to comment.