postgres-12-image/Dockerfile

46 lines
1.7 KiB
Docker

# SPDX-License-Identifier: MIT
#!BuildTag: suse/postgres:12
#!BuildTag: suse/postgres:12-%RELEASE%
#!BuildTag: suse/postgres:%%pg_version%%
FROM opensuse/tumbleweed:latest
MAINTAINER SUSE LLC (https://www.suse.com/)
# Define labels according to https://en.opensuse.org/Building_derived_containers
# labelprefix=com.suse.application.postgres
LABEL org.opencontainers.image.title="SLE PostgreSQL 12 Container Image"
LABEL org.opencontainers.image.description="PostgreSQL 12 based on the SLE Base Container Image."
LABEL org.opencontainers.image.version="12"
LABEL org.opencontainers.image.url="https://www.suse.com/products/server/"
LABEL org.opencontainers.image.created="%BUILDTIME%"
LABEL org.opencontainers.image.vendor="SUSE LLC"
LABEL org.opensuse.reference="registry.suse.com/suse/postgres:12-%RELEASE%"
LABEL org.openbuildservice.disturl="%DISTURL%"
LABEL com.suse.supportlevel="techpreview"
LABEL com.suse.eula="sle-bci"
LABEL com.suse.lifecycle-url="https://www.suse.com/lifecycle"
LABEL com.suse.image-type="application"
LABEL com.suse.release-stage="beta"
# endlabelprefix
RUN set -euo pipefail && zypper -n in --no-recommends postgresql12-server distribution-release && zypper -n clean && rm -rf /var/log/*
ENV LANG="en_US.utf8"
ENV PG_MAJOR="12"
ENV PG_VERSION="%%pg_version%%"
ENV PGDATA="/var/lib/postgresql/data"
ENTRYPOINT ["docker-entrypoint.sh"]
CMD ["postgres"]
VOLUME /var/lib/postgresql/data
COPY docker-entrypoint.sh /usr/local/bin/
RUN set -euo pipefail && chmod +x /usr/local/bin/docker-entrypoint.sh && \
ln -s su /usr/bin/gosu && \
mkdir /docker-entrypoint-initdb.d && \
sed -ri "s|^#?(listen_addresses)\s*=\s*\S+.*|\1 = '*'|" /usr/share/postgresql12/postgresql.conf.sample
STOPSIGNAL SIGINT
EXPOSE 5432