Skip to content

Instantly share code, notes, and snippets.

@philpep
Created September 3, 2021 14:22
Show Gist options
  • Save philpep/38b21c68ea200e15cf6beaef55f7caa2 to your computer and use it in GitHub Desktop.
Save philpep/38b21c68ea200e15cf6beaef55f7caa2 to your computer and use it in GitHub Desktop.
#!/bin/sh
echo "shared_preload_libraries = 'timescaledb'" >> /etc/postgresql/12/main/postgresql.conf
pg_ctlcluster start 12 main
su - postgres -c "psql -d postgres -c 'create extension timescaledb'"
pg_upgradecluster -m upgrade 12 main
exec bash
FROM debian:bullseye-slim
RUN apt-get update && apt-get -y install --no-install-recommends wget gnupg ca-certificates && rm -rf /var/lib/apt/lists/*
RUN wget https://www.postgresql.org/media/keys/ACCC4CF8.asc -O /etc/apt/trusted.gpg.d/pgdg.asc
RUN echo "deb http://apt.postgresql.org/pub/repos/apt bullseye-pgdg main" > /etc/apt/sources.list.d/pgdg.list
RUN wget https://packagecloud.io/timescale/timescaledb/gpgkey -O /etc/apt/trusted.gpg.d/timescaledb.asc
RUN echo "deb https://packagecloud.io/timescale/timescaledb/debian/ bullseye main" > /etc/apt/sources.list.d/timescaledb.list
RUN apt-get update && apt-get -y install --no-install-recommends \
postgresql-12 \
timescaledb-2-loader-postgresql-12 \
timescaledb-2-postgresql-12 \
postgresql-13 \
timescaledb-2-loader-postgresql-13 \
timescaledb-2-postgresql-13 \
&& rm -rf /var/lib/apt/lists/* \
&& pg_dropcluster 13 main
COPY bug.sh /
CMD ["bash", "/bug.sh"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment