Skip to content
This repository was archived by the owner on Aug 7, 2025. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions postgres/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ RUN source /os-release && \
mkdir /install_root \
&& swupd os-install -V ${VERSION_ID} \
--path /install_root --statedir /swupd-state \
--bundles=postgresql11,su-exec --no-boot-update
--bundles=postgresql12,su-exec --no-boot-update

# For some Host OS configuration with redirect_dir on,
# extra data are saved on the upper layer when the same
Expand All @@ -31,10 +31,10 @@ FROM clearlinux/os-core:latest

COPY --from=builder /install_root /

ENV PATH $PATH:/usr/libexec/postgresql11
ENV PATH $PATH:/usr/libexec/postgresql12
ENV PGDATA /var/lib/pgsql/data
RUN sed -i "s|#listen_addresses.*|listen_addresses = '*'|" /usr/share/postgresql11/postgresql.conf.sample && \
mkdir -p /run/postgresql11 && chown -R postgres:postgres /run/postgresql11 && \
RUN sed -i "s|#listen_addresses.*|listen_addresses = '*'|" /usr/share/postgresql12/postgresql.conf.sample && \
mkdir -p /run/postgresql12 && chown -R postgres:postgres /run/postgresql12 && \
mkdir -p "$PGDATA" && chown -R postgres:postgres "$PGDATA" && \
mkdir /docker-entrypoint-initdb.d && \
mkdir -p /usr/local/bin
Expand All @@ -43,7 +43,7 @@ VOLUME /var/lib/pgsql/data
COPY docker-entrypoint.sh /usr/local/bin/
RUN chmod +x /usr/local/bin/docker-entrypoint.sh && \
ln -s /usr/local/bin/docker-entrypoint.sh / && \
ln -s /usr/share/postgresql11 /usr/share/postgresql
ln -s /usr/share/postgresql12 /usr/share/postgresql

ENTRYPOINT ["docker-entrypoint.sh"]

Expand Down
6 changes: 3 additions & 3 deletions postgres/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ if [ "$1" = 'postgres' ] && [ "$(id -u)" = '0' ]; then
chown -R postgres "$PGDATA"
chmod 700 "$PGDATA"

mkdir -p /var/run/postgresql11
chown -R postgres /var/run/postgresql11
chmod 775 /var/run/postgresql11
mkdir -p /var/run/postgresql12
chown -R postgres /var/run/postgresql12
chmod 775 /var/run/postgresql12

# Create the transaction log directory before initdb is run (below) so the directory is owned by the correct user
if [ "$POSTGRES_INITDB_WALDIR" ]; then
Expand Down