2024-09-09 09:30:52 +02:00
|
|
|
# SPDX-License-Identifier: PostgreSQL
|
|
|
|
|
|
|
|
# Copyright (c) 2024 SUSE LLC
|
|
|
|
|
|
|
|
# All modifications and additions to the file contributed by third parties
|
|
|
|
# remain the property of their copyright owners, unless otherwise agreed
|
|
|
|
# upon.
|
|
|
|
|
|
|
|
# The content of THIS FILE IS AUTOGENERATED and should not be manually modified.
|
|
|
|
# It is maintained by the BCI team and generated by
|
|
|
|
# https://github.com/SUSE/BCI-dockerfile-generator
|
|
|
|
|
|
|
|
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
|
|
|
# You can contact the BCI team via https://github.com/SUSE/bci/discussions
|
|
|
|
|
2024-09-12 12:47:06 +02:00
|
|
|
#!UseOBSRepositories
|
2024-09-09 09:30:52 +02:00
|
|
|
|
2024-10-14 13:34:46 +02:00
|
|
|
#!BuildTag: opensuse/postgres:%%pg_patch_version%%-%RELEASE%
|
|
|
|
#!BuildTag: opensuse/postgres:%%pg_patch_version%%
|
2024-10-11 17:28:00 +02:00
|
|
|
#!BuildTag: opensuse/postgres:16
|
2024-09-09 09:30:52 +02:00
|
|
|
#!BuildTag: opensuse/postgres:%%pg_minor_version%%
|
|
|
|
#!BuildTag: opensuse/postgres:latest
|
|
|
|
|
|
|
|
FROM opensuse/tumbleweed:latest
|
|
|
|
|
2024-09-25 19:58:54 +02:00
|
|
|
RUN set -euo pipefail; \
|
|
|
|
zypper -n install --no-recommends libpq5 postgresql16-server findutils; \
|
|
|
|
zypper -n clean; \
|
|
|
|
rm -rf {/target,}/var/log/{alternatives.log,lastlog,tallylog,zypper.log,zypp/history,YaST2}
|
2024-09-09 09:30:52 +02:00
|
|
|
|
|
|
|
# Define labels according to https://en.opensuse.org/Building_derived_containers
|
|
|
|
# labelprefix=org.opensuse.application.postgres
|
|
|
|
LABEL org.opencontainers.image.title="openSUSE Tumbleweed PostgreSQL 16"
|
|
|
|
LABEL org.opencontainers.image.description="PostgreSQL 16 container based on the openSUSE Tumbleweed Base Container Image."
|
|
|
|
LABEL org.opencontainers.image.version="%%pg_patch_version%%"
|
|
|
|
LABEL org.opencontainers.image.url="https://www.opensuse.org"
|
|
|
|
LABEL org.opencontainers.image.created="%BUILDTIME%"
|
|
|
|
LABEL org.opencontainers.image.vendor="openSUSE Project"
|
|
|
|
LABEL org.opencontainers.image.source="%SOURCEURL%"
|
2024-10-14 13:34:46 +02:00
|
|
|
LABEL org.opencontainers.image.ref.name="%%pg_patch_version%%-%RELEASE%"
|
|
|
|
LABEL org.opensuse.reference="registry.opensuse.org/opensuse/postgres:%%pg_patch_version%%-%RELEASE%"
|
2024-09-09 09:30:52 +02:00
|
|
|
LABEL org.openbuildservice.disturl="%DISTURL%"
|
|
|
|
LABEL org.opensuse.lifecycle-url="https://en.opensuse.org/Lifetime#openSUSE_BCI"
|
|
|
|
LABEL org.opensuse.release-stage="released"
|
|
|
|
# endlabelprefix
|
|
|
|
LABEL io.artifacthub.package.readme-url="https://raw.githubusercontent.com/SUSE/BCI-dockerfile-generator/Tumbleweed/postgres-16-image/README.md"
|
|
|
|
ENV LANG="en_US.utf8"
|
|
|
|
ENV PG_MAJOR="16"
|
|
|
|
ENV PG_VERSION="%%pg_minor_version%%"
|
|
|
|
ENV PGDATA="/var/lib/pgsql/data"
|
|
|
|
|
|
|
|
ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"]
|
|
|
|
CMD ["postgres"]
|
2024-10-31 17:14:10 +01:00
|
|
|
EXPOSE 5432/tcp
|
2024-09-09 09:30:52 +02:00
|
|
|
COPY docker-entrypoint.sh /usr/local/bin/
|
|
|
|
RUN set -euo pipefail; chmod +x /usr/local/bin/docker-entrypoint.sh; \
|
|
|
|
sed -i -e 's/exec gosu postgres "/exec setpriv --reuid=postgres --regid=postgres --clear-groups -- "/g' /usr/local/bin/docker-entrypoint.sh; \
|
|
|
|
mkdir /docker-entrypoint-initdb.d; \
|
|
|
|
install -m 1775 -o postgres -g postgres -d /run/postgresql; \
|
|
|
|
install -d -m 0700 -o postgres -g postgres $PGDATA; \
|
|
|
|
sed -ri "s|^#?(listen_addresses)\s*=\s*\S+.*|\1 = '*'|" /usr/share/postgresql16/postgresql.conf.sample
|
|
|
|
|
|
|
|
STOPSIGNAL SIGINT
|
|
|
|
HEALTHCHECK --interval=10s --start-period=10s --timeout=5s \
|
|
|
|
CMD pg_isready -U ${POSTGRES_USER:-postgres} -h localhost -p 5432
|
|
|
|
|
|
|
|
VOLUME $PGDATA
|