Skip to content

Commit 391b38c

Browse files
committed
update setuidgid for tests
1 parent fd953b4 commit 391b38c

2 files changed

Lines changed: 7 additions & 6 deletions

File tree

Containerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ LABEL org.opencontainers.image.title="PostgreSQL ${PG_VERSION}" \
2020
io.daemonless.arch="${FREEBSD_ARCH}" \
2121
io.daemonless.category="Databases" \
2222
io.daemonless.upstream-url="${UPSTREAM_URL}" \
23-
io.daemonless.packages="${PACKAGES}"
23+
io.daemonless.packages="${PACKAGES}" \
24+
org.freebsd.jail.allow.sysvipc="required"
2425

2526
# Install PostgreSQL
2627
RUN pkg update && \

root/etc/services.d/postgresql/run

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,16 @@ if [ ! -f "$PGDATA/PG_VERSION" ]; then
1717

1818
# Configure authentication method (default: scram-sha-256)
1919
AUTH_METHOD="${POSTGRES_HOST_AUTH_METHOD:-scram-sha-256}"
20-
echo "host all all 0.0.0.0/0 $AUTH_METHOD" >> "$PGDATA/pg_hba.conf"
21-
echo "host all all ::/0 $AUTH_METHOD" >> "$PGDATA/pg_hba.conf"
22-
echo "local all all trust" >> "$PGDATA/pg_hba.conf"
20+
/usr/local/bin/s6-setuidgid bsd sh -c "echo 'host all all 0.0.0.0/0 $AUTH_METHOD' >> '$PGDATA/pg_hba.conf'"
21+
/usr/local/bin/s6-setuidgid bsd sh -c "echo 'host all all ::/0 $AUTH_METHOD' >> '$PGDATA/pg_hba.conf'"
22+
/usr/local/bin/s6-setuidgid bsd sh -c "echo 'local all all trust' >> '$PGDATA/pg_hba.conf'"
2323

2424
# Listen on all interfaces
25-
echo "listen_addresses = '*'" >> "$PGDATA/postgresql.conf"
25+
/usr/local/bin/s6-setuidgid bsd sh -c "echo \"listen_addresses = '*'\" >> '$PGDATA/postgresql.conf'"
2626

2727
# Add shared_preload_libraries if specified (required for extensions like vchord)
2828
if [ -n "$POSTGRES_SHARED_PRELOAD_LIBRARIES" ]; then
29-
echo "shared_preload_libraries = '$POSTGRES_SHARED_PRELOAD_LIBRARIES'" >> "$PGDATA/postgresql.conf"
29+
/usr/local/bin/s6-setuidgid bsd sh -c "echo \"shared_preload_libraries = '$POSTGRES_SHARED_PRELOAD_LIBRARIES'\" >> '$PGDATA/postgresql.conf'"
3030
fi
3131

3232
# Start temporarily to create user/database and run init scripts

0 commit comments

Comments
 (0)