[info=220c57d8fbdabcc19b886e8fc640a40d]

OBS-URL: https://build.opensuse.org/package/show/devel:BCI:Tumbleweed/postgres-13-image?expand=0&rev=4
This commit is contained in:
Dan Čermák 2022-11-23 09:33:18 +00:00 committed by Git OBS Bridge
parent b1bb8cb014
commit 03d987cddd
5 changed files with 23 additions and 17 deletions

View File

@ -2,6 +2,7 @@
#!BuildTag: opensuse/postgres:13
#!BuildTag: opensuse/postgres:13-%RELEASE%
#!BuildTag: opensuse/postgres:%%pg_version%%
FROM opensuse/tumbleweed:latest
MAINTAINER openSUSE (https://www.opensuse.org/)
@ -20,18 +21,16 @@ LABEL org.openbuildservice.disturl="%DISTURL%"
LABEL com.suse.release-stage="released"
# endlabelprefix
RUN set -euo pipefail; zypper -n in --no-recommends postgresql13-server distribution-release; zypper -n clean; rm -rf /var/log/*
ENV LANG="en_US.utf8"
ENV PG_MAJOR="13"
ENV PG_VERSION="%%pg_version%%"
ENV PGDATA="/var/lib/postgresql/data"
ENTRYPOINT ["docker-entrypoint.sh"]
CMD ["postgres"]
VOLUME /var/lib/postgresql/data
EXPOSE 5432
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; \
@ -39,4 +38,3 @@ RUN set -euo pipefail; chmod +x /usr/local/bin/docker-entrypoint.sh; \
sed -ri "s|^#?(listen_addresses)\s*=\s*\S+.*|\1 = '*'|" /usr/share/postgresql13/postgresql.conf.sample
STOPSIGNAL SIGINT
EXPOSE 5432

7
_constraints Normal file
View File

@ -0,0 +1,7 @@
<constraints>
<hardware>
<disk>
<size unit="G">8</size>
</disk>
</hardware>
</constraints>

View File

@ -1,11 +1,10 @@
<services>
<service mode="buildtime" name="kiwi_metainfo_helper"/>
<service mode="buildtime" name="docker_label_helper"/>
<service name="replace_using_package_version" mode="buildtime">
<service name="replace_using_package_version" mode="buildtime">
<param name="file">Dockerfile</param>
<param name="regex">%%pg_version%%</param>
<param name="package">postgresql13-server</param>
<param name="parse-version">minor</param>
</service>
</services>

View File

@ -45,7 +45,7 @@ docker_create_db_directories() {
chmod 775 /var/run/postgresql || :
# Create the transaction log directory before initdb is run so the directory is owned by the correct user
if [ -n "$POSTGRES_INITDB_WALDIR" ]; then
if [ -n "${POSTGRES_INITDB_WALDIR:-}" ]; then
mkdir -p "$POSTGRES_INITDB_WALDIR"
if [ "$user" = '0' ]; then
find "$POSTGRES_INITDB_WALDIR" \! -user postgres -exec chown postgres '{}' +
@ -84,7 +84,7 @@ docker_init_database_dir() {
done
fi
if [ -n "$POSTGRES_INITDB_WALDIR" ]; then
if [ -n "${POSTGRES_INITDB_WALDIR:-}" ]; then
set -- --waldir "$POSTGRES_INITDB_WALDIR" "$@"
fi
@ -172,10 +172,11 @@ docker_process_init_files() {
. "$f"
fi
;;
*.sql) echo "$0: running $f"; docker_process_sql -f "$f"; echo ;;
*.sql.gz) echo "$0: running $f"; gunzip -c "$f" | docker_process_sql; echo ;;
*.sql.xz) echo "$0: running $f"; xzcat "$f" | docker_process_sql; echo ;;
*) echo "$0: ignoring $f" ;;
*.sql) echo "$0: running $f"; docker_process_sql -f "$f"; echo ;;
*.sql.gz) echo "$0: running $f"; gunzip -c "$f" | docker_process_sql; echo ;;
*.sql.xz) echo "$0: running $f"; xzcat "$f" | docker_process_sql; echo ;;
*.sql.zst) echo "$0: running $f"; zstd -dc "$f" | docker_process_sql; echo ;;
*) echo "$0: ignoring $f" ;;
esac
echo
done
@ -240,10 +241,6 @@ pg_setup_hba_conf() {
local auth
# check the default/configured encryption and use that as the auth method
auth="$(postgres -C password_encryption "$@")"
# postgres 9 only reports "on" and not "md5"
if [ "$auth" = 'on' ]; then
auth='md5'
fi
: "${POSTGRES_HOST_AUTH_METHOD:=$auth}"
{
echo

View File

@ -1,3 +1,8 @@
-------------------------------------------------------------------
Mon Nov 21 13:47:17 UTC 2022 - Dan Čermák <dcermak@suse.com>
- Add _constraints to prevent FTBFS with small worker root partitions
-------------------------------------------------------------------
Fri Jul 15 11:08:47 UTC 2022 - Dan Čermák <dcermak@suse.com>