Skip to content

Commit 7e3dc11

Browse files
Use debian based image for postgres 13 and 16
1 parent 288326c commit 7e3dc11

File tree

3 files changed

+30
-108
lines changed

3 files changed

+30
-108
lines changed

.github/workflows/database.yml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,6 @@ jobs:
3333
postgis_version: "3.4.2"
3434
dockerfile: "pg13_16.Dockerfile"
3535
image_version: "pg16-ts2.14.2-postgis3.4.2"
36-
- pg_major: "16"
37-
timescaledb_version: "2.14.2"
38-
postgis_version: "3.4.2"
39-
dockerfile: "pg16_debian.Dockerfile"
40-
image_version: "bookworm-pg16-ts2.14.2-postgis3.4.2"
4136
permissions:
4237
contents: read
4338
packages: write

infra/docker/database/pg13_16.Dockerfile

Lines changed: 30 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -2,79 +2,35 @@ ARG PG_MAJOR
22
ARG TIMESCALEDB_VERSION
33
ARG POSTGIS_VERSION
44

5-
FROM timescale/timescaledb:${TIMESCALEDB_VERSION}-pg${PG_MAJOR}
5+
FROM postgres:$PG_MAJOR-bookworm
6+
ARG PG_MAJOR
7+
ARG TIMESCALEDB_VERSION
68
ARG POSTGIS_VERSION
79

8-
RUN set -eux \
9-
&& apk add --no-cache --virtual .fetch-deps \
10-
ca-certificates \
11-
openssl \
12-
tar \
13-
\
14-
&& wget -O postgis.tar.gz "https://github.com/postgis/postgis/archive/${POSTGIS_VERSION}.tar.gz" \
15-
&& mkdir -p /usr/src/postgis \
16-
&& tar \
17-
--extract \
18-
--file postgis.tar.gz \
19-
--directory /usr/src/postgis \
20-
--strip-components 1 \
21-
&& rm postgis.tar.gz \
22-
\
23-
&& apk add --no-cache --virtual .build-deps \
24-
\
25-
gdal-dev \
26-
geos-dev \
27-
proj-dev \
28-
proj-util \
29-
sfcgal-dev \
30-
\
31-
# The upstream variable, '$DOCKER_PG_LLVM_DEPS' contains
32-
# the correct versions of 'llvm-dev' and 'clang' for the current version of PostgreSQL.
33-
# This improvement has been discussed in https://github.com/docker-library/postgres/pull/1077
34-
$DOCKER_PG_LLVM_DEPS \
35-
\
36-
autoconf \
37-
automake \
38-
cunit-dev \
39-
file \
40-
g++ \
41-
gcc \
42-
gettext-dev \
43-
git \
44-
json-c-dev \
45-
libtool \
46-
libxml2-dev \
47-
make \
48-
pcre2-dev \
49-
perl \
50-
protobuf-c-dev \
51-
\
52-
# build PostGIS - with Link Time Optimization (LTO) enabled
53-
&& cd /usr/src/postgis \
54-
&& gettextize \
55-
&& ./autogen.sh \
56-
&& ./configure \
57-
--enable-lto \
58-
&& make -j$(nproc) \
59-
&& make install \
60-
\
61-
# add .postgis-rundeps
62-
&& apk add --no-cache --virtual .postgis-rundeps \
63-
\
64-
gdal \
65-
geos \
66-
proj \
67-
sfcgal \
68-
\
69-
json-c \
70-
libstdc++ \
71-
pcre2 \
72-
protobuf-c \
73-
\
74-
# ca-certificates: for accessing remote raster files
75-
# fix https://github.com/postgis/docker-postgis/issues/307
76-
ca-certificates \
77-
# clean
78-
&& cd / \
79-
&& rm -rf /usr/src/postgis \
80-
&& apk del .fetch-deps .build-deps \
10+
RUN \
11+
apt-get update && \
12+
apt-get install -y \
13+
wget \
14+
lsb-release
15+
16+
# Install TimescaleDB extension
17+
RUN echo "deb https://packagecloud.io/timescale/timescaledb/debian/ $(lsb_release -c -s) main"
18+
RUN echo "deb https://packagecloud.io/timescale/timescaledb/debian/ $(lsb_release -c -s) main" > /etc/apt/sources.list.d/timescaledb.list
19+
RUN wget --quiet -O - https://packagecloud.io/timescale/timescaledb/gpgkey | apt-key add -
20+
21+
RUN \
22+
TIMESCALEDB_MAJOR=$(echo $TIMESCALEDB_VERSION | cut -c1) && \
23+
apt-get update && \
24+
apt-get install -y \
25+
timescaledb-$TIMESCALEDB_MAJOR-postgresql-$PG_MAJOR=$TIMESCALEDB_VERSION* \
26+
timescaledb-$TIMESCALEDB_MAJOR-loader-postgresql-$PG_MAJOR=$TIMESCALEDB_VERSION* && \
27+
rm -rf /var/lib/apt/lists/*
28+
29+
# Install PostGIS extension
30+
RUN \
31+
POSTGIS_MAJOR=$(echo $POSTGIS_VERSION | cut -c1) && \
32+
apt update && \
33+
apt install -y --no-install-recommends \
34+
postgresql-$PG_MAJOR-postgis-$POSTGIS_MAJOR=$POSTGIS_VERSION* \
35+
postgresql-$PG_MAJOR-postgis-$POSTGIS_MAJOR-scripts && \
36+
rm -rf /var/lib/apt/lists/*

infra/docker/database/pg16_debian.Dockerfile

Lines changed: 0 additions & 29 deletions
This file was deleted.

0 commit comments

Comments
 (0)