Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Add 2 helpers for adding extension more easily #398

Closed
wants to merge 1 commit into from

Conversation

mscherer
Copy link
Contributor

This PR should go along #394, that as I as a basis to get postgis in postgresql.

I used that dockerfile:

FROM registry.fedoraproject.org/f33/postgresql
USER 0
RUN mkdir -p postgresql-cfg && echo "shared_preload_libraries='postgis-3'" > postgresql-cfg/postgis.conf
RUN mkdir -p postgresql-init && echo -en 'echo "CREATE EXTENSION IF NOT EXISTS postgis;" | psql' > postgresql-init/enable_postgis.sh
RUN dnf install --setopt=install_weak_deps=False --best -y postgis && dnf clean all
USER 26

However, with the addition of the 2 helpers, I think this could be simplified to be:

FROM postgres-fedora
USER 0
RUN dnf install --setopt=install_weak_deps=False --best -y postgis && dnf clean all
RUN load_pg_library postgis-3 
RUN create_extension postgis 
USER 26

This permit to hide implementation details, and avoid cut and paste (since postgis provides 4 extensions), and stupid errors (i took me a while to get a working container).

I marked the PR as WIP since there is no doc as I do not know where you would like to add it, and there is also no test (but I guess this can be done with pgaudit).

@centos-ci
Copy link
Collaborator

Can one of the admins verify this patch?

2 similar comments
@centos-ci
Copy link
Collaborator

Can one of the admins verify this patch?

@centos-ci
Copy link
Collaborator

Can one of the admins verify this patch?

@mscherer
Copy link
Contributor Author

So, upon further experimentaion, I think the part about creating the extension may not always work (as I need to create it per database, and I do not know enough of postgres if that's a good or bad idea). I guess we could add a 3rd hook for that (create in the database).

Is it safe to assume that the container will be used with 1 single database, and not shared accross multiple pod with multiple db ?

@mscherer
Copy link
Contributor Author

Replaced by #399

@mscherer mscherer closed this Feb 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants