Skip to content

Commit 1163c59

Browse files
committed
ROX-19980 fix
1 parent 9360fb2 commit 1163c59

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

image/db/rhel/Dockerfile.slim

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,16 @@ USER 70:70
5959

6060
ENV ROX_SLIM_MODE="true"
6161

62-
ENTRYPOINT ["docker-entrypoint.sh"]
62+
COPY scripts/custom-entrypoint.sh /usr/local/bin/
63+
COPY scripts/start-db.sh /usr/local/bin/
64+
65+
RUN /usr/local/bin/start-db.sh
66+
USER root
67+
RUN rm -rf /usr/local/bin/start-db.sh && \
68+
rm -rf /docker-entrypoint-initdb.d/*
69+
USER 70:70
70+
ENV DATABASE_ALREADY_EXISTS=true
71+
ENTRYPOINT ["custom-entrypoint.sh"]
6372

6473
EXPOSE 5432
6574
CMD ["postgres", "-c", "config_file=/etc/postgresql.conf"]

image/db/rhel/scripts/custom-entrypoint.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ if [ ! -d "/var/lib/postgresql/data/pgdata" ]; then
3232
if [ -n "$POSTGRES_PASSWORD" ]; then
3333
PGPASSWORD=postgres psql -c "ALTER USER postgres WITH PASSWORD '$POSTGRES_PASSWORD';"
3434
elif [ -n "$POSTGRES_PASSWORD_FILE" ]; then
35-
PGPASSWORD=$(cat "$POSTGRES_PASSWORD_FILE") psql -c "ALTER USER postgres WITH PASSWORD '$POSTGRES_PASSWORD';"
35+
PGPASSWORD=postgres psql -c "ALTER USER postgres WITH PASSWORD '$(cat "$POSTGRES_PASSWORD_FILE")';"
3636
fi
3737

3838
echo "Renaming postgres user if necessary..."

0 commit comments

Comments
 (0)