forked from pool/postgres-16-image
Compare commits
36 Commits
Author | SHA256 | Date | |
---|---|---|---|
|
254e4a5400 | ||
e0392cf239 | |||
|
d9b46abf6c | ||
|
0b184cae5f | ||
a46a0aab20 | |||
|
85550321b8 | ||
bed961e29b | |||
97c15994da | |||
|
61055a8491 | ||
bd9944be6e | |||
|
bbed9b4d7e | ||
4516b680a7 | |||
|
4653c8b6ce | ||
e3d2268dc4 | |||
|
f12528dc95 | ||
5fa4041baa | |||
06f97211b7 | |||
0ea557afa3 | |||
40d76609a9 | |||
a1d51f5316 | |||
57edeb41fe | |||
4461c39830 | |||
|
94a7ff8168 | ||
be552039c4 | |||
fd4a8fbca9 | |||
f0826afc85 | |||
|
6d698f2efd | ||
|
a2f2518ac3 | ||
e4d14c20f4 | |||
3234f08e35 | |||
7fa3e125e7 | |||
7dfecb829f | |||
|
88abe6ae04 | ||
cde23c8200 | |||
|
5306f5fc8d | ||
23c2d4aaed |
33
Dockerfile
33
Dockerfile
@ -1,6 +1,6 @@
|
|||||||
# SPDX-License-Identifier: PostgreSQL
|
# SPDX-License-Identifier: PostgreSQL
|
||||||
|
|
||||||
# Copyright (c) 2024 SUSE LLC
|
# Copyright (c) 2025 SUSE LLC
|
||||||
|
|
||||||
# All modifications and additions to the file contributed by third parties
|
# All modifications and additions to the file contributed by third parties
|
||||||
# remain the property of their copyright owners, unless otherwise agreed
|
# remain the property of their copyright owners, unless otherwise agreed
|
||||||
@ -13,29 +13,34 @@
|
|||||||
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
||||||
# You can contact the BCI team via https://github.com/SUSE/bci/discussions
|
# You can contact the BCI team via https://github.com/SUSE/bci/discussions
|
||||||
|
|
||||||
|
#!UseOBSRepositories
|
||||||
|
|
||||||
|
#!BuildTag: opensuse/postgres:%%pg_patch_version%%-%RELEASE%
|
||||||
|
#!BuildTag: opensuse/postgres:%%pg_patch_version%%
|
||||||
#!BuildTag: opensuse/postgres:16
|
#!BuildTag: opensuse/postgres:16
|
||||||
#!BuildTag: opensuse/postgres:16-%RELEASE%
|
#!BuildTag: opensuse/postgres:%%pg_minor_version%%
|
||||||
#!BuildTag: opensuse/postgres:%%pg_version%%
|
|
||||||
#!BuildTag: opensuse/postgres:%%pg_version%%-%RELEASE%
|
|
||||||
#!BuildTag: opensuse/postgres:latest
|
|
||||||
|
|
||||||
FROM opensuse/tumbleweed:latest
|
FROM opensuse/bci/bci-micro:latest AS target
|
||||||
|
FROM opensuse/tumbleweed:latest AS builder
|
||||||
RUN set -euo pipefail; zypper -n in --no-recommends postgresql16-server findutils; zypper -n clean; rm -rf /var/log/{lastlog,tallylog,zypper.log,zypp/history,YaST2}
|
COPY --from=target / /target
|
||||||
|
|
||||||
|
RUN set -euo pipefail; \
|
||||||
|
zypper -n --installroot /target --gpg-auto-import-keys install --no-recommends libpq5 postgresql16-server findutils coreutils sed util-linux; \
|
||||||
|
zypper -n clean; \
|
||||||
|
rm -rf {/target,}/var/log/{alternatives.log,lastlog,tallylog,zypper.log,zypp/history,YaST2}
|
||||||
|
FROM opensuse/bci/bci-micro:latest
|
||||||
|
COPY --from=builder /target /
|
||||||
# Define labels according to https://en.opensuse.org/Building_derived_containers
|
# Define labels according to https://en.opensuse.org/Building_derived_containers
|
||||||
# labelprefix=org.opensuse.application.postgres
|
# labelprefix=org.opensuse.application.postgres
|
||||||
LABEL org.opencontainers.image.authors="openSUSE (https://www.opensuse.org/)"
|
|
||||||
LABEL org.opencontainers.image.title="openSUSE Tumbleweed PostgreSQL 16"
|
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.description="PostgreSQL 16 container based on the openSUSE Tumbleweed Base Container Image."
|
||||||
LABEL org.opencontainers.image.version="16"
|
LABEL org.opencontainers.image.version="%%pg_patch_version%%"
|
||||||
LABEL org.opencontainers.image.url="https://www.opensuse.org"
|
LABEL org.opencontainers.image.url="https://www.opensuse.org"
|
||||||
LABEL org.opencontainers.image.created="%BUILDTIME%"
|
LABEL org.opencontainers.image.created="%BUILDTIME%"
|
||||||
LABEL org.opencontainers.image.vendor="openSUSE Project"
|
LABEL org.opencontainers.image.vendor="openSUSE Project"
|
||||||
LABEL org.opencontainers.image.source="%SOURCEURL%"
|
LABEL org.opencontainers.image.source="%SOURCEURL%"
|
||||||
LABEL org.opencontainers.image.ref.name="16-%RELEASE%"
|
LABEL org.opencontainers.image.ref.name="%%pg_patch_version%%-%RELEASE%"
|
||||||
LABEL org.opensuse.reference="registry.opensuse.org/opensuse/postgres:16-%RELEASE%"
|
LABEL org.opensuse.reference="registry.opensuse.org/opensuse/postgres:%%pg_patch_version%%-%RELEASE%"
|
||||||
LABEL org.openbuildservice.disturl="%DISTURL%"
|
LABEL org.openbuildservice.disturl="%DISTURL%"
|
||||||
LABEL org.opensuse.lifecycle-url="https://en.opensuse.org/Lifetime#openSUSE_BCI"
|
LABEL org.opensuse.lifecycle-url="https://en.opensuse.org/Lifetime#openSUSE_BCI"
|
||||||
LABEL org.opensuse.release-stage="released"
|
LABEL org.opensuse.release-stage="released"
|
||||||
@ -43,12 +48,12 @@ LABEL org.opensuse.release-stage="released"
|
|||||||
LABEL io.artifacthub.package.readme-url="https://raw.githubusercontent.com/SUSE/BCI-dockerfile-generator/Tumbleweed/postgres-16-image/README.md"
|
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 LANG="en_US.utf8"
|
||||||
ENV PG_MAJOR="16"
|
ENV PG_MAJOR="16"
|
||||||
ENV PG_VERSION="%%pg_version%%"
|
ENV PG_VERSION="%%pg_minor_version%%"
|
||||||
ENV PGDATA="/var/lib/pgsql/data"
|
ENV PGDATA="/var/lib/pgsql/data"
|
||||||
|
|
||||||
ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"]
|
ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"]
|
||||||
CMD ["postgres"]
|
CMD ["postgres"]
|
||||||
EXPOSE 5432
|
EXPOSE 5432/tcp
|
||||||
COPY docker-entrypoint.sh /usr/local/bin/
|
COPY docker-entrypoint.sh /usr/local/bin/
|
||||||
RUN set -euo pipefail; chmod +x /usr/local/bin/docker-entrypoint.sh; \
|
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; \
|
sed -i -e 's/exec gosu postgres "/exec setpriv --reuid=postgres --regid=postgres --clear-groups -- "/g' /usr/local/bin/docker-entrypoint.sh; \
|
||||||
|
@ -24,6 +24,10 @@ $ podman run -it --rm -p 5432:5432 -e POSTGRES_PASSWORD=my-password -v /path/to/
|
|||||||
|
|
||||||
PostgreSQL data directory location.
|
PostgreSQL data directory location.
|
||||||
|
|
||||||
|
**Note 1:** The directory must be empty for `initdb` to create a new database.
|
||||||
|
|
||||||
|
**Note 2:** If the volume points either to a file system mount point, a remote folder that cannot be owned by the `postgres` user, or a location that already contains files (including `lost+found` and dotfiles), a new subdirectory for storing the PostgreSQL data must be created within the `PGDATA` volume.
|
||||||
|
|
||||||
## Environment variables
|
## Environment variables
|
||||||
|
|
||||||
The PostgreSQL image uses several environment variables to configure the database initialization.
|
The PostgreSQL image uses several environment variables to configure the database initialization.
|
||||||
|
10
_service
10
_service
@ -1,10 +1,16 @@
|
|||||||
<services>
|
<services>
|
||||||
<service mode="buildtime" name="docker_label_helper"/>
|
<service mode="buildtime" name="docker_label_helper"/>
|
||||||
<service mode="buildtime" name="kiwi_metainfo_helper"/>
|
<service mode="buildtime" name="kiwi_metainfo_helper"/>
|
||||||
<service name="replace_using_package_version" mode="buildtime">
|
<service mode="buildtime" name="replace_using_package_version">
|
||||||
<param name="file">Dockerfile</param>
|
<param name="file">Dockerfile</param>
|
||||||
<param name="regex">%%pg_version%%</param>
|
<param name="regex">%%pg_minor_version%%</param>
|
||||||
<param name="package">postgresql16-server</param>
|
<param name="package">postgresql16-server</param>
|
||||||
<param name="parse-version">minor</param>
|
<param name="parse-version">minor</param>
|
||||||
</service>
|
</service>
|
||||||
|
<service mode="buildtime" name="replace_using_package_version">
|
||||||
|
<param name="file">Dockerfile</param>
|
||||||
|
<param name="regex">%%pg_patch_version%%</param>
|
||||||
|
<param name="package">postgresql16-server</param>
|
||||||
|
<param name="parse-version">patch</param>
|
||||||
|
</service>
|
||||||
</services>
|
</services>
|
@ -104,7 +104,7 @@ docker_init_database_dir() {
|
|||||||
# assumes database is not set up, ie: [ -z "$DATABASE_ALREADY_EXISTS" ]
|
# assumes database is not set up, ie: [ -z "$DATABASE_ALREADY_EXISTS" ]
|
||||||
docker_verify_minimum_env() {
|
docker_verify_minimum_env() {
|
||||||
case "${PG_MAJOR:-}" in
|
case "${PG_MAJOR:-}" in
|
||||||
12 | 13) # https://github.com/postgres/postgres/commit/67a472d71c98c3d2fa322a1b4013080b20720b98
|
13) # https://github.com/postgres/postgres/commit/67a472d71c98c3d2fa322a1b4013080b20720b98
|
||||||
# check password first so we can output the warning before postgres
|
# check password first so we can output the warning before postgres
|
||||||
# messes it up
|
# messes it up
|
||||||
if [ "${#POSTGRES_PASSWORD}" -ge 100 ]; then
|
if [ "${#POSTGRES_PASSWORD}" -ge 100 ]; then
|
||||||
@ -252,7 +252,7 @@ pg_setup_hba_conf() {
|
|||||||
printf '\n'
|
printf '\n'
|
||||||
if [ 'trust' = "$POSTGRES_HOST_AUTH_METHOD" ]; then
|
if [ 'trust' = "$POSTGRES_HOST_AUTH_METHOD" ]; then
|
||||||
printf '# warning trust is enabled for all connections\n'
|
printf '# warning trust is enabled for all connections\n'
|
||||||
printf '# see https://www.postgresql.org/docs/12/auth-trust.html\n'
|
printf '# see https://www.postgresql.org/docs/17/auth-trust.html\n'
|
||||||
fi
|
fi
|
||||||
printf 'host all all all %s\n' "$POSTGRES_HOST_AUTH_METHOD"
|
printf 'host all all all %s\n' "$POSTGRES_HOST_AUTH_METHOD"
|
||||||
} >> "$PGDATA/pg_hba.conf"
|
} >> "$PGDATA/pg_hba.conf"
|
||||||
|
@ -1,3 +1,88 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Wed Feb 5 10:30:31 UTC 2025 - SUSE Update Bot <bci-internal@suse.de>
|
||||||
|
|
||||||
|
- remove handling for outdated postgresql versions
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Wed Jan 29 14:06:29 UTC 2025 - SUSE Update Bot <bci-internal@suse.de>
|
||||||
|
|
||||||
|
- update README to add hints about the persistent volume requirements
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Wed Jan 1 14:13:48 UTC 2025 - SUSE Update Bot <bci-internal@suse.de>
|
||||||
|
|
||||||
|
- update copyright year
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Tue Dec 3 13:26:37 UTC 2024 - SUSE Update Bot <bci-internal@suse.de>
|
||||||
|
|
||||||
|
- Change attribute order in _service
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Tue Nov 26 14:34:27 UTC 2024 - SUSE Update Bot <bci-internal@suse.de>
|
||||||
|
|
||||||
|
- Switch latest tag from postgres 16 to postgres 17
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Thu Nov 14 17:06:30 UTC 2024 - SUSE Update Bot <bci-internal@suse.de>
|
||||||
|
|
||||||
|
- switch to multistage build
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Wed Oct 30 18:28:27 UTC 2024 - SUSE Update Bot <bci-internal@suse.de>
|
||||||
|
|
||||||
|
- be explicit in protocol for expose statement
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Wed Oct 30 15:34:45 UTC 2024 - SUSE Update Bot <bci-internal@suse.de>
|
||||||
|
|
||||||
|
- remove nonsensical org.opencontainers.image.authors - duplication of .vendor
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Tue Oct 29 15:23:20 UTC 2024 - SUSE Update Bot <bci-internal@suse.de>
|
||||||
|
|
||||||
|
- drop tag_version-%RELEASE%
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Mon Oct 14 11:26:26 UTC 2024 - SUSE Update Bot <bci-internal@suse.de>
|
||||||
|
|
||||||
|
- make the version-%release tag the first one listed; remove duplicates where they existed; update image.ref/reference to point to the version-%release(-) tag
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Fri Oct 11 15:12:52 UTC 2024 - SUSE Update Bot <bci-internal@suse.de>
|
||||||
|
|
||||||
|
- make the tag with -%RELEASE% the first tag listed
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Wed Sep 25 17:36:16 UTC 2024 - Dirk Mueller <dmueller@suse.com>
|
||||||
|
|
||||||
|
- rerender installation step in multiple lines, allow uninstalling optional packages
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Wed Sep 25 17:12:11 UTC 2024 - Dirk Mueller <dmueller@suse.com>
|
||||||
|
|
||||||
|
- improved log cleaning
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Wed Sep 25 10:02:07 UTC 2024 - Dirk Mueller <dmueller@suse.com>
|
||||||
|
|
||||||
|
- install libpq5 to avoid have-choice errors
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Tue Sep 24 20:00:32 UTC 2024 - Dirk Mueller <dmueller@suse.com>
|
||||||
|
|
||||||
|
- remove release tags for additional_versions
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Thu Sep 12 10:37:22 UTC 2024 - Dirk Mueller <dmueller@suse.com>
|
||||||
|
|
||||||
|
- set useobsrepositories explicitly
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Mon Sep 9 07:25:11 UTC 2024 - Dirk Mueller <dmueller@suse.com>
|
||||||
|
|
||||||
|
- set full version on labels and tags
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Fri Aug 16 07:07:46 UTC 2024 - Dirk Mueller <dmueller@suse.com>
|
Fri Aug 16 07:07:46 UTC 2024 - Dirk Mueller <dmueller@suse.com>
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user