sclorg / postgresql-container

PostgreSQL container images based on Red Hat Software Collections and intended for OpenShift and general usage. Users can choose between Red Hat Enterprise Linux, Fedora, and CentOS based images.
http://softwarecollections.org
Apache License 2.0
164 stars 216 forks source link

add initialization example script #481

Open aushacker opened 1 year ago

aushacker commented 1 year ago

A simple example showing how to configure a database with some test data.

When using ephemeral storage the database name specified by POSTGRESQL_DATABASE must be different from that created in the user provided script, otherwise the container will crash loop. This is due to the default scripts hard failing when trying to create a database that the user supplied init script has already created.

See issue #296 for narrative (known problem).

phracek commented 1 year ago

[test-all]

aushacker commented 1 year ago

@phracek Have had a look through the available tests, none of them seem to match the required procedure.

What is needed to test would be something like:

  1. Build base image
  2. Create a new image, layering in postgresql-init/initialize.sh
  3. Spin up the image from 2 in podman/docker
  4. Use a postgresql client to connect and query the quotes database

How does that fit in with the current testing procedure?

fila43 commented 1 year ago

I do not see any problem with proposed example

fila43 commented 1 year ago

[test-all]

phracek commented 1 year ago

@aushacker Thank you for this pull request. Please do following steps:

github-actions[bot] commented 1 week ago

Pull Request validation

Failed

🔴 Review - Missing review from a member (2 required)

Success

🟢 CI - All checks have passed