2ndQuadrant / pglogical

Logical Replication extension for PostgreSQL 17, 16, 15, 14, 13, 12, 11, 10, 9.6, 9.5, 9.4 (Postgres), providing much faster replication than Slony, Bucardo or Londiste, as well as cross-version upgrades.
http://2ndquadrant.com/en/resources/pglogical/
Other
1.02k stars 154 forks source link

Unable to create docker image #429

Open apgapg opened 1 year ago

apgapg commented 1 year ago

I am trying to extend bitnami postgresql with timescaledb and pglogical extension. Somehow adding pglogical gives errors.

My dockerfile looks like following:


USER root

RUN install_packages build-essential git

RUN apt update && \
    apt -y install cmake && \
    apt-get -y install libssl-dev && \
    git clone https://github.com/timescale/timescaledb && \
    cd timescaledb && \
    git checkout 2.9.1 && \
    ./bootstrap && \
    cd build && \
    make install && \
    apt-get -y update && apt-get -y install curl && \
    curl https://techsupport.enterprisedb.com/api/repository/dl/default/release/deb | bash && \
    apt-get install postgresql-15-pglogical && \
    apt-get remove -y build-essential git cmake && \
    apt-get autoremove -y && \
    rm -rf /timescaledb && \
    rm -rf /var/lib/apt/lists/*

USER 1001

Here I am unable to add pglogical curl https://techsupport.enterprisedb.com/api/repository/dl/default/release/deb | bash && \ apt-get install postgresql-15-pglogical && \

Following are the errors generated:

image

apgapg commented 1 year ago

Have fixed this using

FROM bitnami/postgresql:15

USER root

RUN install_packages build-essential git

RUN apt update && \
    apt -y install cmake && \
    apt-get -y install libssl-dev && \
    git clone https://github.com/timescale/timescaledb && \
    cd timescaledb && \
    git checkout 2.9.1 && \
    ./bootstrap && \
    cd build && \
    make install  

RUN apt-get update

RUN apt-get -y install curl ca-certificates wget

RUN apt-get -y install gnupg2

RUN curl https://techsupport.enterprisedb.com/api/repository/dl/default/release/deb | bash 

RUN sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list' && wget -qO- https://www.postgresql.org/media/keys/ACCC4CF8.asc | tee /etc/apt/trusted.gpg.d/pgdg.asc &>/dev/null
RUN apt-get update && apt-get install -y postgresql-15 postgresql-client
RUN apt-get install -y postgresql-15-pglogical

RUN apt-get remove -y build-essential git cmake && \
    apt-get autoremove -y && \
    rm -rf /timescaledb && \
    rm -rf /var/lib/apt/lists/*

# copy required assets to bitnami's postgreSQL directory
RUN cp -r /usr/share/postgresql/15/extension/pglogical* /opt/bitnami/postgresql/share/extension/ && \
    cp -r /usr/lib/postgresql/15/lib/pglogical* /opt/bitnami/postgresql/lib/

RUN apt-get remove -y postgresql-15 postgresql-client postgresql-15-pglogical

USER 1001

Need to install gnupg2 and postgres apt packages

apgapg commented 12 months ago

One can use this image below:

https://hub.docker.com/repository/docker/ayushpgupta/postgresql-timescaledb-pglogical/general