Skip to content

Commit eaba60a

Browse files
committed
Merge branch '5-timescaledb-compartibility' into 'master'
fix: build images with TimescaleDB for PostgreSQL 9.6 and 10 (#5) See merge request postgres-ai/custom-images!29
2 parents bd55e45 + 508daa2 commit eaba60a

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

extended-postgres/Dockerfile

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,20 @@ RUN apt-get clean && rm -rf /var/lib/apt/lists/partial \
3838
&& cd /tmp/pg_hint_plan-PG${PG_PLAN_HINT_VERSION} \
3939
&& make && make install \
4040
# timescaledb extension
41-
&& echo "deb https://packagecloud.io/timescale/timescaledb/debian/ $(lsb_release -c -s) main" > /etc/apt/sources.list.d/timescaledb.list \
42-
&& wget --quiet -O - https://packagecloud.io/timescale/timescaledb/gpgkey | sudo apt-key add - \
43-
&& apt-get update \
44-
&& apt install -y timescaledb-2-postgresql-${PG_SERVER_VERSION} \
41+
&& if [ $(echo "$PG_SERVER_VERSION < 11" | /usr/bin/bc) = "1" ]; then \
42+
echo 'deb https://packagecloud.io/timescale/timescaledb/debian/' \
43+
$(env -i bash -c '. /etc/os-release; echo ${VERSION_CODENAME}') \
44+
'main' > /etc/apt/sources.list.d/timescaledb.list \
45+
&& wget --quiet -O - \
46+
https://packagecloud.io/timescale/timescaledb/gpgkey | sudo apt-key add - \
47+
&& apt-get update \
48+
&& apt-get install -y timescaledb-postgresql-${PG_SERVER_VERSION}; \
49+
else \
50+
echo "deb https://packagecloud.io/timescale/timescaledb/debian/ $(lsb_release -c -s) main" > /etc/apt/sources.list.d/timescaledb.list \
51+
&& wget --quiet -O - https://packagecloud.io/timescale/timescaledb/gpgkey | sudo apt-key add - \
52+
&& apt-get update \
53+
&& apt install -y timescaledb-2-postgresql-${PG_SERVER_VERSION}; \
54+
fi \
4555
# powa extension
4656
&& apt-get install postgresql-${PG_SERVER_VERSION}-powa \
4757
# pgaudit extension

0 commit comments

Comments
 (0)