Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .github/workflows/build-and-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,14 @@ jobs:
quayio_token: "QUAY_IMAGE_SCLORG_BUILDER_TOKEN"
docker_context: 16

- dockerfile: "18/Dockerfile.c9s"
registry_namespace: "sclorg"
tag: "c9s"
image_name: "postgresql-18-c9s"
quayio_username: "QUAY_IMAGE_SCLORG_BUILDER_USERNAME"
quayio_token: "QUAY_IMAGE_SCLORG_BUILDER_TOKEN"
docker_context: 18

- dockerfile: "16/Dockerfile.c10s"
registry_namespace: "sclorg"
tag: "c10s"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/container-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
needs: check-readme
uses: "sclorg/ci-actions/.github/workflows/container-tests.yml@main"
with:
enabled-tests: '["container", "container-pytest", "openshift-4", "openshift-pytest"]'
enabled-tests: '["container", "container-pytest", "openshift-pytest"]'
versions: '[ "12", "13", "15", "16", "18" ]'
openshift-versions: '[ "12", "13", "15", "16", "18" ]'
secrets: inherit
92 changes: 92 additions & 0 deletions 18/Dockerfile.c9s
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
FROM quay.io/sclorg/s2i-core-c9s:c9s

# PostgreSQL image for OpenShift.
# Volumes:
# * /var/lib/pgsql/data - Database cluster for PostgreSQL
# Environment:
# * $POSTGRESQL_USER - Database user name
# * $POSTGRESQL_PASSWORD - User's password
# * $POSTGRESQL_DATABASE - Name of the database to create
# * $POSTGRESQL_ADMIN_PASSWORD (Optional) - Password for the 'postgres'
# PostgreSQL administrative account

ENV POSTGRESQL_VERSION=18 \
POSTGRESQL_PREV_VERSION=16 \
HOME=/var/lib/pgsql \
PGUSER=postgres \
APP_DATA=/opt/app-root

ENV SUMMARY="PostgreSQL is an advanced Object-Relational database management system" \
DESCRIPTION="PostgreSQL is an advanced Object-Relational database management system (DBMS). \
The image contains the client and server programs that you'll need to \
create, run, maintain and access a PostgreSQL DBMS server."

LABEL summary="$SUMMARY" \
description="$DESCRIPTION" \
io.k8s.description="$DESCRIPTION" \
io.k8s.display-name="PostgreSQL 18" \
io.openshift.expose-services="5432:postgresql" \
io.openshift.tags="database,postgresql,postgresql18,postgresql-18" \
io.openshift.s2i.assemble-user="26" \
name="sclorg/postgresql-18-c9s" \
com.redhat.component="postgresql-18-container" \
version="1" \
usage="podman run -d --name postgresql_database -e POSTGRESQL_USER=user -e POSTGRESQL_PASSWORD=pass -e POSTGRESQL_DATABASE=db -p 5432:5432 sclorg/postgresql-18-c9s" \
maintainer="SoftwareCollections.org <[email protected]>"

EXPOSE 5432

COPY root/usr/libexec/fix-permissions /usr/libexec/fix-permissions

# This image must forever use UID 26 for postgres user so our volumes are
# safe in the future. This should *never* change, the last test is there
# to make sure of that.
RUN { yum -y module enable postgresql:18 || :; } && \
INSTALL_PKGS="rsync tar gettext nss_wrapper-libs postgresql-server postgresql-contrib" && \
INSTALL_PKGS="$INSTALL_PKGS pgaudit" && \
INSTALL_PKGS="$INSTALL_PKGS procps-ng util-linux postgresql-upgrade" && \
INSTALL_PKGS="$INSTALL_PKGS pgvector" && \
yum -y --setopt=tsflags=nodocs install $INSTALL_PKGS && \
rpm -V $INSTALL_PKGS && \
postgres -V | grep -qe "$POSTGRESQL_VERSION\." && echo "Found VERSION $POSTGRESQL_VERSION" && \
yum -y clean all --enablerepo='*' && \
localedef -f UTF-8 -i en_US en_US.UTF-8 && \
test "$(id postgres)" = "uid=26(postgres) gid=26(postgres) groups=26(postgres)" && \
mkdir -p /var/lib/pgsql/data && \
mkdir -p /run/postgresql && \
/usr/libexec/fix-permissions /var/lib/pgsql /run/postgresql

# Get prefix path and path to scripts rather than hard-code them in scripts
ENV CONTAINER_SCRIPTS_PATH=/usr/share/container-scripts/postgresql \
ENABLED_COLLECTIONS=

COPY root /
COPY ./s2i/bin/ $STI_SCRIPTS_PATH

# Hard links are not supported in Testing Farm approach during sync to guest
# operation system. Therefore tests are failing on error
# /usr/libexec/s2i/run no such file or directory
RUN ln -s /usr/bin/run-postgresql $STI_SCRIPTS_PATH/run

# Not using VOLUME statement since it's not working in OpenShift Online:
# https://github.com/sclorg/httpd-container/issues/30
# VOLUME ["/var/lib/pgsql/data"]

# S2I permission fixes
# --------------------
# 1. unless specified otherwise (or - equivalently - we are in OpenShift), s2i
# build process would be executed as 'uid=26(postgres) gid=26(postgres)'.
# Such process wouldn't be able to execute the default 'assemble' script
# correctly (it transitively executes 'fix-permissions' script). So let's
# add the 'postgres' user into 'root' group here
#
# 2. we call fix-permissions on $APP_DATA here directly (UID=0 during build
# anyways) to assure that s2i process is actually able to _read_ the
# user-specified scripting.
RUN usermod -a -G root postgres && \
/usr/libexec/fix-permissions --read-only "$APP_DATA"

USER 26

ENTRYPOINT ["container-entrypoint"]
CMD ["run-postgresql"]
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Table start
|13|<details><summary>✓</summary>`quay.io/sclorg/postgresql-13-c9s`</details>|||<details><summary>✓</summary>`registry.redhat.io/rhel8/postgresql-13`</details>|<details><summary>✓</summary>`registry.redhat.io/rhel9/postgresql-13`</details>||
|15|<details><summary>✓</summary>`quay.io/sclorg/postgresql-15-c9s`</details>||<details><summary>✓</summary>`quay.io/fedora/postgresql-15`</details>|<details><summary>✓</summary>`registry.redhat.io/rhel8/postgresql-15`</details>|<details><summary>✓</summary>`registry.redhat.io/rhel9/postgresql-15`</details>||
|16|<details><summary>✓</summary>`quay.io/sclorg/postgresql-16-c9s`</details>|<details><summary>✓</summary>`quay.io/sclorg/postgresql-16-c10s`</details>|<details><summary>✓</summary>`quay.io/fedora/postgresql-16`</details>|<details><summary>✓</summary>`registry.redhat.io/rhel8/postgresql-16`</details>|<details><summary>✓</summary>`registry.redhat.io/rhel9/postgresql-16`</details>|<details><summary>✓</summary>`registry.redhat.io/rhel10/postgresql-16`</details>|
|18||<details><summary>✓</summary>`quay.io/sclorg/postgresql-18-c10s`</details>|<details><summary>✓</summary>`quay.io/fedora/postgresql-18`</details>||<details><summary>✓</summary>`registry.redhat.io/rhel9/postgresql-18`</details>|<details><summary>✓</summary>`registry.redhat.io/rhel10/postgresql-18`</details>|
|18|<details><summary>✓</summary>`quay.io/sclorg/postgresql-18-c9s`</details>|<details><summary>✓</summary>`quay.io/sclorg/postgresql-18-c10s`</details>|<details><summary>✓</summary>`quay.io/fedora/postgresql-18`</details>||<details><summary>✓</summary>`registry.redhat.io/rhel9/postgresql-18`</details>|<details><summary>✓</summary>`registry.redhat.io/rhel10/postgresql-18`</details>|
<!--
Table end
-->
Expand Down
1 change: 1 addition & 0 deletions specs/multispec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ matrix:
- version: "18"
distros:
- fedora-43-x86_64
- centos-stream-9-x86_64
- centos-stream-10-x86_64
- rhel-9-x86_64
- rhel-10-x86_64
41 changes: 0 additions & 41 deletions test/run-openshift-remote-cluster

This file was deleted.

1 change: 0 additions & 1 deletion test/test-lib-openshift.sh

This file was deleted.

87 changes: 0 additions & 87 deletions test/test-lib-postgresql.sh

This file was deleted.

1 change: 0 additions & 1 deletion test/test-lib-remote-openshift.sh

This file was deleted.