|
|
66b98f |
# SPDX-License-Identifier: MIT
|
|
|
80bcfd |
|
|
Bernhard M. Wiedemann |
2dafcc |
# Copyright (c) 2024 SUSE LLC
|
|
|
80bcfd |
|
|
|
80bcfd |
|
|
|
80bcfd |
|
|
|
80bcfd |
# upon.
|
|
|
80bcfd |
|
|
|
80bcfd |
|
|
|
80bcfd |
|
|
|
80bcfd |
# https://github.com/SUSE/BCI-dockerfile-generator
|
|
|
80bcfd |
|
|
|
80bcfd |
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
|
|
80bcfd |
|
|
|
80bcfd |
|
|
|
80bcfd |
|
|
|
66b98f |
#!BuildTag: opensuse/postgres:13
|
|
|
66b98f |
#!BuildTag: opensuse/postgres:13-%RELEASE%
|
|
|
66b98f |
#!BuildTag: opensuse/postgres:%%pg_version%%
|
|
|
66b98f |
#!BuildTag: opensuse/postgres:%%pg_version%%-%RELEASE%
|
|
|
66b98f |
|
|
|
66b98f |
FROM opensuse/tumbleweed:latest
|
|
|
66b98f |
|
|
|
66b98f |
# Define labels according to https://en.opensuse.org/Building_derived_containers
|
|
|
66b98f |
# labelprefix=org.opensuse.application.postgres
|
|
|
20ca8c |
LABEL org.opencontainers.image.authors="openSUSE (https://www.opensuse.org/)"
|
|
|
66b98f |
LABEL org.opencontainers.image.title="openSUSE Tumbleweed PostgreSQL 13"
|
|
|
66b98f |
LABEL org.opencontainers.image.description="PostgreSQL 13 container based on the openSUSE Tumbleweed Base Container Image."
|
|
|
66b98f |
LABEL org.opencontainers.image.version="13"
|
|
|
66b98f |
LABEL org.opencontainers.image.url="https://www.opensuse.org"
|
|
|
66b98f |
LABEL org.opencontainers.image.created="%BUILDTIME%"
|
|
|
66b98f |
LABEL org.opencontainers.image.vendor="openSUSE Project"
|
|
|
66b98f |
LABEL org.opencontainers.image.source="%SOURCEURL%"
|
|
|
d36d03 |
LABEL org.opencontainers.image.ref.name="13-%RELEASE%"
|
|
|
66b98f |
LABEL org.opensuse.reference="registry.opensuse.org/opensuse/postgres:13-%RELEASE%"
|
|
|
66b98f |
LABEL org.openbuildservice.disturl="%DISTURL%"
|
|
|
cb2894 |
LABEL org.opensuse.lifecycle-url="https://en.opensuse.org/Lifetime#openSUSE_BCI"
|
|
|
66b98f |
LABEL org.opensuse.release-stage="released"
|
|
|
66b98f |
# endlabelprefix
|
|
|
599743 |
LABEL io.artifacthub.package.readme-url="https://raw.githubusercontent.com/SUSE/BCI-dockerfile-generator/Tumbleweed/postgres-13-image/README.md"
|
|
|
66b98f |
|
|
|
218279 |
RUN set -euo pipefail; zypper -n in --no-recommends postgresql13-server findutils; zypper -n clean; rm -rf /var/log/{lastlog,tallylog,zypper.log,zypp/history,YaST2}
|
|
|
66b98f |
ENV LANG="en_US.utf8"
|
|
|
66b98f |
ENV PG_MAJOR="13"
|
|
|
66b98f |
ENV PG_VERSION="%%pg_version%%"
|
|
|
66b98f |
ENV PGDATA="/var/lib/pgsql/data"
|
|
|
66b98f |
|
|
|
66b98f |
ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"]
|
|
|
66b98f |
CMD ["postgres"]
|
|
|
66b98f |
EXPOSE 5432
|
|
|
66b98f |
COPY docker-entrypoint.sh /usr/local/bin/
|
|
|
66b98f |
RUN set -euo pipefail; chmod +x /usr/local/bin/docker-entrypoint.sh; \
|
|
|
66b98f |
sed -i -e 's/exec gosu postgres "/exec setpriv --reuid=postgres --regid=postgres --clear-groups -- "/g' /usr/local/bin/docker-entrypoint.sh; \
|
|
|
66b98f |
mkdir /docker-entrypoint-initdb.d; \
|
|
|
6380fd |
install -m 1775 -o postgres -g postgres -d /run/postgresql; \
|
|
|
66b98f |
install -d -m 0700 -o postgres -g postgres $PGDATA; \
|
|
|
66b98f |
sed -ri "s|^#?(listen_addresses)\s*=\s*\S+.*|\1 = '*'|" /usr/share/postgresql13/postgresql.conf.sample
|
|
|
66b98f |
|
|
|
66b98f |
STOPSIGNAL SIGINT
|
|
|
66b98f |
HEALTHCHECK --interval=10s --start-period=10s --timeout=5s \
|
|
|
66b98f |
CMD pg_isready -U ${POSTGRES_USER:-postgres} -h localhost -p 5432
|
|
|
66b98f |
|
|
|
66b98f |
VOLUME $PGDATA
|