@@ -2,79 +2,35 @@ ARG PG_MAJOR
2
2
ARG TIMESCALEDB_VERSION
3
3
ARG POSTGIS_VERSION
4
4
5
- FROM timescale/timescaledb:${TIMESCALEDB_VERSION}-pg${PG_MAJOR}
5
+ FROM postgres:$PG_MAJOR-bookworm
6
+ ARG PG_MAJOR
7
+ ARG TIMESCALEDB_VERSION
6
8
ARG POSTGIS_VERSION
7
9
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/*
0 commit comments