Skip to content

Instantly share code, notes, and snippets.

@asaaki
Last active March 15, 2021 20:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save asaaki/b07dccfd6ff6eed4c7b4ef279ade7b0c to your computer and use it in GitHub Desktop.
Save asaaki/b07dccfd6ff6eed4c7b4ef279ade7b0c to your computer and use it in GitHub Desktop.
PostgreSQL 11.5 with pglogical 2.2.2 as docker image
FROM postgres:11.5
RUN apt-get update && apt-get install -y curl
RUN curl https://dl.2ndquadrant.com/default/release/get/deb | bash && apt-get update
### IMPORTANT: use 2.2.2 instead of 2.2.1! Otherwise PG 11.5 is very sad!
RUN apt-get install -y -V postgresql-${PG_MAJOR}-pglogical=2.2.2-1.stretch+1
# the following copied from https://github.com/reediculous456/docker-pglogical/blob/master/Dockerfile
RUN echo "wal_level = 'logical'" >> /usr/share/postgresql/postgresql.conf.sample && \
echo "max_worker_processes = 10" >> /usr/share/postgresql/postgresql.conf.sample && \
echo "max_replication_slots = 10" >> /usr/share/postgresql/postgresql.conf.sample && \
echo "max_wal_senders = 10" >> /usr/share/postgresql/postgresql.conf.sample && \
echo "shared_preload_libraries = 'pglogical'" >> /usr/share/postgresql/postgresql.conf.sample
RUN echo "host replication postgres 172.18.0.0/16 trust" >> /usr/share/postgresql/${PG_MAJOR}/pg_hba.conf.sample && \
echo "host replication postgres ::1/128 trust" >> /usr/share/postgresql/${PG_MAJOR}/pg_hba.conf.sample
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment