Skip to content

Commit

Permalink
Ensure pg_rewind is included in path
Browse files Browse the repository at this point in the history
  • Loading branch information
davissp14 committed Aug 7, 2024
1 parent 0e58cbc commit c8ae926
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 14 deletions.
17 changes: 10 additions & 7 deletions pg16/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,19 @@ COPY ./bin/* /fly/bin/

FROM ubuntu:24.04

ENV PGDATA=/data/postgresql
ENV PGPASSFILE=/data/.pgpass
ENV AWS_SHARED_CREDENTIALS_FILE=/data/.aws/credentials
ARG VERSION
ARG PG_MAJOR_VERSION
ARG POSTGIS_MAJOR=3
ARG HAPROXY_VERSION=2.8
ARG REPMGR_VERSION=5.4.1-1build2

ENV PGDATA=/data/postgresql
ENV PGPASSFILE=/data/.pgpass
ENV AWS_SHARED_CREDENTIALS_FILE=/data/.aws/credentials
ENV PG_MAJOR_VERSION=${PG_MAJOR_VERSION}
ENV PATH="/usr/lib/postgresql/${PG_MAJOR_VERSION}/bin:$PATH"


LABEL fly.app_role=postgres_cluster
LABEL fly.version=${VERSION}
LABEL fly.pg-version=${PG_VERSION}
Expand Down Expand Up @@ -63,16 +67,15 @@ RUN apt-get update && apt-get install --no-install-recommends -y \
haproxy=$HAPROXY_VERSION.\* \
&& apt autoremove -y && apt clean


# Add PostgreSQL bin directory to PATH
ENV PATH="/usr/lib/postgresql/${PG_MAJOR_VERSION}/bin:$PATH"

# Copy Go binaries from the builder stage
COPY --from=builder /fly/bin/* /usr/local/bin

# Copy Postgres exporter
COPY --from=wrouesnel/postgres_exporter:latest /postgres_exporter /usr/local/bin/

# Move pg_rewind into path.
RUN ln -s /usr/lib/postgresql/${PG_MAJOR_VERSION}/bin/pg_rewind /usr/bin/pg_rewind

ADD /config/* /fly/
RUN mkdir -p /run/haproxy/
RUN usermod -d /data postgres
Expand Down
16 changes: 9 additions & 7 deletions pg16/Dockerfile-timescaledb
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,18 @@ COPY ./bin/* /fly/bin/

FROM ubuntu:24.04

ENV PGDATA=/data/postgresql
ENV PGPASSFILE=/data/.pgpass
ENV AWS_SHARED_CREDENTIALS_FILE=/data/.aws/credentials
ARG VERSION
ARG PG_MAJOR_VERSION
ARG POSTGIS_MAJOR=3
ARG HAPROXY_VERSION=2.8
ARG REPMGR_VERSION=5.4.1-1build2

ENV PGDATA=/data/postgresql
ENV PGPASSFILE=/data/.pgpass
ENV AWS_SHARED_CREDENTIALS_FILE=/data/.aws/credentials
ENV PG_MAJOR_VERSION=${PG_MAJOR_VERSION}
ENV PATH="/usr/lib/postgresql/${PG_MAJOR_VERSION}/bin:$PATH"

LABEL fly.app_role=postgres_cluster
LABEL fly.version=${VERSION}
LABEL fly.pg-version=${PG_VERSION}
Expand Down Expand Up @@ -69,16 +72,15 @@ RUN apt-get update && apt-get install --no-install-recommends -y \
haproxy=$HAPROXY_VERSION.\* \
&& apt autoremove -y && apt clean


# Add PostgreSQL bin directory to PATH
ENV PATH="/usr/lib/postgresql/${PG_MAJOR_VERSION}/bin:$PATH"

# Copy Go binaries from the builder stage
COPY --from=builder /fly/bin/* /usr/local/bin

# Copy Postgres exporter
COPY --from=wrouesnel/postgres_exporter:latest /postgres_exporter /usr/local/bin/

# Move pg_rewind into path.
RUN ln -s /usr/lib/postgresql/${PG_MAJOR_VERSION}/bin/pg_rewind /usr/bin/pg_rewind

ADD /config/* /fly/
RUN mkdir -p /run/haproxy/
RUN usermod -d /data postgres
Expand Down

0 comments on commit c8ae926

Please sign in to comment.