Skip to content

Commit

Permalink
debug
Browse files Browse the repository at this point in the history
Signed-off-by: xieydd <[email protected]>
  • Loading branch information
xieydd committed Nov 13, 2024
1 parent f2604e6 commit 4b8b651
Showing 1 changed file with 20 additions and 20 deletions.
40 changes: 20 additions & 20 deletions docker/pg-slim/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ ENV CFLAGS "-g -O2 -fstack-protector-strong -Wformat -Werror=format-security -fn
ENV LDFLAGS "-Wl,-z,relro -Wl,-z,now"
RUN ./configure --prefix=/usr/lib/postgresql/${PG_MAJOR} \
--datarootdir=${ALTDIR} \
--libdir=${ALTDIR}/${PG_VERSION}/lib \
--libdir=${ALTDIR}/${PG_MAJOR}/lib \
--with-perl \
--with-python \
--with-tcl \
Expand Down Expand Up @@ -112,29 +112,29 @@ WORKDIR /
RUN rm -rf /postgres

RUN mkdir -p /var/run/postgresql && chmod 775 /var/run/postgresql
RUN mkdir -p /usr/share/postgresql/${PG_MAJOR}/extension && chmod 775 /usr/share/postgresql/${PG_MAJOR}/extension
# RUN mkdir -p /usr/share/postgresql/${PG_MAJOR}/extension && chmod 775 /usr/share/postgresql/${PG_MAJOR}/extension

COPY --from=tianon/gosu /gosu /usr/local/bin/
# COPY --from=tianon/gosu /gosu /usr/local/bin/

# make the sample config easier to munge (and "correct by default")
RUN set -eux; \
echo "unix_socket_directories = '/var/run/postgresql'" >> ${ALTDIR}/postgresql.conf.sample; \
sed -ri "s!^#?(listen_addresses)\s*=\s*\S+.*!\1 = '*'!" ${ALTDIR}/postgresql.conf.sample; \
grep -F "listen_addresses = '*'" ${ALTDIR}/postgresql.conf.sample
# # make the sample config easier to munge (and "correct by default")
# RUN set -eux; \
# echo "unix_socket_directories = '/var/run/postgresql'" >> ${ALTDIR}/postgresql.conf.sample; \
# sed -ri "s!^#?(listen_addresses)\s*=\s*\S+.*!\1 = '*'!" ${ALTDIR}/postgresql.conf.sample; \
# grep -F "listen_addresses = '*'" ${ALTDIR}/postgresql.conf.sample

RUN install --verbose --directory --owner postgres --group postgres --mode 3777 /var/run/postgresql
# RUN install --verbose --directory --owner postgres --group postgres --mode 3777 /var/run/postgresql

# this 1777 will be replaced by 0700 at runtime (allows semi-arbitrary "--user" values)
RUN install --verbose --directory --owner postgres --group postgres --mode 1777 ${PGDATA}
# # this 1777 will be replaced by 0700 at runtime (allows semi-arbitrary "--user" values)
# RUN install --verbose --directory --owner postgres --group postgres --mode 1777 ${PGDATA}

ENV PATH $PATH:/usr/lib/postgresql/$PG_MAJOR/bin:/usr/local/bin
COPY docker-entrypoint.sh docker-ensure-initdb.sh /usr/local/bin/
RUN ln -sT docker-ensure-initdb.sh /usr/local/bin/docker-enforce-initdb.sh
ENTRYPOINT ["docker-entrypoint.sh"]
# ENV PATH $PATH:/usr/lib/postgresql/$PG_MAJOR/bin:/usr/local/bin
# COPY docker-entrypoint.sh docker-ensure-initdb.sh /usr/local/bin/
# RUN ln -sT docker-ensure-initdb.sh /usr/local/bin/docker-enforce-initdb.sh
# ENTRYPOINT ["docker-entrypoint.sh"]

# Remove pre-installed pg_config
RUN rm /usr/bin/pg_config
# # Remove pre-installed pg_config
# RUN rm /usr/bin/pg_config

STOPSIGNAL SIGINT
EXPOSE 5432
CMD ["postgres"]
# STOPSIGNAL SIGINT
# EXPOSE 5432
# CMD ["postgres"]

0 comments on commit 4b8b651

Please sign in to comment.