Create pg_partman extension to docker Postgres 14

1k Views Asked by At

How can we add pg_partman extension to docker postgres:14 image. I have DB that needs this extension..

https://gist.github.com/jgould22/3280fc0f531485f4fe19a2ef1ef67361

this does not work

1

There are 1 best solutions below

0
On

I had the same need and created a container image. Feel free to use it:

docker run ghcr.io/dbsystel/postgresql-partman

It is based on the bitnami postgresql image and we provide nightly builds of quite a few postgres/partman version combinations. Find more info and the documentation directly at the GitHub Repo.

If you still wish to build your own image (and not build ontop of the one we build), this should do it

RUN cd /tmp \
    && wget "https://github.com/pgpartman/pg_partman/archive/refs/tags/${PARTMAN_VERSION}.tar.gz" \
    && echo "${PARTMAN_CHECKSUM} ${PARTMAN_VERSION}.tar.gz" | sha512sum --check \
    && export C_INCLUDE_PATH=/opt/bitnami/postgresql/include/:/opt/bitnami/common/include/ \
    && export LIBRARY_PATH=/opt/bitnami/postgresql/lib/:/opt/bitnami/common/lib/ \
    && export LD_LIBRARY_PATH=/opt/bitnami/postgresql/lib/:/opt/bitnami/common/lib/ \
    && tar zxf ${PARTMAN_VERSION}.tar.gz && cd pg_partman-${PARTMAN_VERSION#v}\
    && make \
    && make install \
    && cd .. && rm -r pg_partman-