Skip to content

Commit

Permalink
Bump to Postgres 14 to use libpq pipeline mode (#732)
Browse files Browse the repository at this point in the history
We have implemented pipeline mode in
#704, but it is not yet enabled
by default as the current docker image has PG13.

Signed-off-by: Arunprasad Rajkumar <ar.arunprasad@gmail.com>
  • Loading branch information
arajkumar authored Apr 2, 2024
1 parent e1dcb60 commit 3362d17
Showing 1 changed file with 22 additions and 4 deletions.
26 changes: 22 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,16 @@ FROM --platform=${TARGETPLATFORM} debian:11-slim as build
ARG TARGETPLATFORM
ARG TARGETOS
ARG TARGETARCH
ARG PGVERSION=14

RUN dpkg --add-architecture ${TARGETARCH:-arm64} && apt update \
&& apt install -qqy --no-install-recommends \
curl \
ca-certificates \
gnupg

RUN curl https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add -
RUN echo "deb http://apt.postgresql.org/pub/repos/apt bullseye-pgdg main ${PGVERSION}" > /etc/apt/sources.list.d/pgdg.list

RUN dpkg --add-architecture ${TARGETARCH:-arm64} && apt update \
&& apt install -qqy --no-install-recommends \
Expand Down Expand Up @@ -35,9 +45,7 @@ RUN dpkg --add-architecture ${TARGETARCH:-arm64} && apt update \
watch \
make \
openssl \
postgresql-common \
postgresql-client-common \
postgresql-server-dev-all \
postgresql-server-dev-${PGVERSION} \
psutils \
tmux \
watch \
Expand All @@ -56,10 +64,20 @@ FROM --platform=${TARGETPLATFORM} debian:11-slim as run
ARG TARGETPLATFORM
ARG TARGETOS
ARG TARGETARCH
ARG PGVERSION=14

# used to configure Github Packages
LABEL org.opencontainers.image.source https://github.com/dimitri/pgcopydb

RUN dpkg --add-architecture ${TARGETARCH:-arm64} && apt update \
&& apt install -qqy --no-install-recommends \
curl \
ca-certificates \
gnupg

RUN curl https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add -
RUN echo "deb http://apt.postgresql.org/pub/repos/apt bullseye-pgdg main ${PGVERSION}" > /etc/apt/sources.list.d/pgdg.list

RUN dpkg --add-architecture ${TARGETARCH:-arm64} && apt update \
&& apt install -qqy --no-install-suggests --no-install-recommends \
sudo \
Expand All @@ -82,7 +100,7 @@ RUN dpkg --add-architecture ${TARGETARCH:-arm64} && apt update \
RUN useradd -rm -d /var/lib/postgres -s /bin/bash -g postgres -G sudo docker
RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers

COPY --from=build --chmod=755 /usr/lib/postgresql/13/bin/pgcopydb /usr/local/bin
COPY --from=build --chmod=755 /usr/lib/postgresql/${PGVERSION}/bin/pgcopydb /usr/local/bin

USER docker

Expand Down

0 comments on commit 3362d17

Please sign in to comment.