Skip to content

Instantly share code, notes, and snippets.

@DanielFGray
Created April 23, 2022 19:35
Show Gist options
  • Save DanielFGray/ae0cb6701cfc04498517677bb0249227 to your computer and use it in GitHub Desktop.
Save DanielFGray/ae0cb6701cfc04498517677bb0249227 to your computer and use it in GitHub Desktop.
postgres with extensions
FROM postgres:14
RUN apt-get update && apt-get upgrade -y
ENV build_deps ca-certificates \
    git \
    build-essential \
    libpq-dev \
    postgresql-server-dev-14
RUN apt-get install -y --no-install-recommends $build_deps

# pgtap
RUN mkdir -p /tmp/build \
  && cd /tmp/build \
    && git clone https://github.com/theory/pgtap \
    && cd pgtap \
    && git checkout tags/v1.2.0 \
    && make install

#pg_hashids
RUN mkdir -p /tmp/build \
    && git clone https://github.com/iCyberon/pg_hashids \
    && cd pg_hashids \
    && make \
    && make install

# plpgsql_check
RUN apt-get install -y --no-install-recommends libicu-dev \
    && cd /tmp/build \
    && git clone https://github.com/okbob/plpgsql_check \
    && cd plpgsql_check \
    && git checkout tags/v2.1.2 \
    && make clean \
    && make install

# pg_cron
RUN mkdir -p /tmp/build \
    && git clone https://github.com/citusdata/pg_cron \
    && cd pg_cron \
    && make \
    && make install

# timescale
RUN timescale_build_deps="cmake libkrb5-dev" \
  && apt-get install -y --no-install-recommends $timescale_build_deps \
    && cd /tmp/build \
    && git clone https://github.com/timescale/timescaledb \
  && cd timescaledb \
  && git checkout tags/2.6.0 \
  && ./bootstrap \
  && cd build && make \
  && make install \
    && apt-get purge -y $timescale_build_deps

RUN rm -fr /tmp/build \
    && apt-get clean \
    && apt-get autoremove -y $build_deps
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment