diff --git a/.github/workflows/database.yml b/.github/workflows/database.yml index d3cea3be54..f481cbda7f 100644 --- a/.github/workflows/database.yml +++ b/.github/workflows/database.yml @@ -33,11 +33,6 @@ jobs: postgis_version: "3.4.2" dockerfile: "pg13_16.Dockerfile" image_version: "pg16-ts2.14.2-postgis3.4.2" - - pg_major: "16" - timescaledb_version: "2.14.2" - postgis_version: "3.4.2" - dockerfile: "pg16_debian.Dockerfile" - image_version: "bookworm-pg16-ts2.14.2-postgis3.4.2" permissions: contents: read packages: write diff --git a/infra/docker/database/pg13_16.Dockerfile b/infra/docker/database/pg13_16.Dockerfile index 8dac82b730..329cadeb72 100644 --- a/infra/docker/database/pg13_16.Dockerfile +++ b/infra/docker/database/pg13_16.Dockerfile @@ -2,79 +2,35 @@ ARG PG_MAJOR ARG TIMESCALEDB_VERSION ARG POSTGIS_VERSION -FROM timescale/timescaledb:${TIMESCALEDB_VERSION}-pg${PG_MAJOR} +FROM postgres:$PG_MAJOR-bookworm +ARG PG_MAJOR +ARG TIMESCALEDB_VERSION ARG POSTGIS_VERSION -RUN set -eux \ - && apk add --no-cache --virtual .fetch-deps \ - ca-certificates \ - openssl \ - tar \ - \ - && wget -O postgis.tar.gz "https://github.com/postgis/postgis/archive/${POSTGIS_VERSION}.tar.gz" \ - && mkdir -p /usr/src/postgis \ - && tar \ - --extract \ - --file postgis.tar.gz \ - --directory /usr/src/postgis \ - --strip-components 1 \ - && rm postgis.tar.gz \ - \ - && apk add --no-cache --virtual .build-deps \ - \ - gdal-dev \ - geos-dev \ - proj-dev \ - proj-util \ - sfcgal-dev \ - \ - # The upstream variable, '$DOCKER_PG_LLVM_DEPS' contains - # the correct versions of 'llvm-dev' and 'clang' for the current version of PostgreSQL. - # This improvement has been discussed in https://github.com/docker-library/postgres/pull/1077 - $DOCKER_PG_LLVM_DEPS \ - \ - autoconf \ - automake \ - cunit-dev \ - file \ - g++ \ - gcc \ - gettext-dev \ - git \ - json-c-dev \ - libtool \ - libxml2-dev \ - make \ - pcre2-dev \ - perl \ - protobuf-c-dev \ - \ -# build PostGIS - with Link Time Optimization (LTO) enabled - && cd /usr/src/postgis \ - && gettextize \ - && ./autogen.sh \ - && ./configure \ - --enable-lto \ - && make -j$(nproc) \ - && make install \ - \ -# add .postgis-rundeps - && apk add --no-cache --virtual .postgis-rundeps \ - \ - gdal \ - geos \ - proj \ - sfcgal \ - \ - json-c \ - libstdc++ \ - pcre2 \ - protobuf-c \ - \ - # ca-certificates: for accessing remote raster files - # fix https://github.com/postgis/docker-postgis/issues/307 - ca-certificates \ -# clean - && cd / \ - && rm -rf /usr/src/postgis \ - && apk del .fetch-deps .build-deps \ +RUN \ + apt-get update && \ + apt-get install -y \ + wget \ + lsb-release + +# Install TimescaleDB extension in both versions of Postgres +RUN echo "deb https://packagecloud.io/timescale/timescaledb/debian/ $(lsb_release -c -s) main" +RUN echo "deb https://packagecloud.io/timescale/timescaledb/debian/ $(lsb_release -c -s) main" > /etc/apt/sources.list.d/timescaledb.list +RUN wget --quiet -O - https://packagecloud.io/timescale/timescaledb/gpgkey | apt-key add - + +RUN \ + TIMESCALEDB_MAJOR=$(echo $TIMESCALEDB_VERSION | cut -c1) && \ + apt-get update && \ + apt-get install -y \ + timescaledb-$TIMESCALEDB_MAJOR-postgresql-$PG_MAJOR=$TIMESCALEDB_VERSION* \ + timescaledb-$TIMESCALEDB_MAJOR-loader-postgresql-$PG_MAJOR=$TIMESCALEDB_VERSION* && \ + rm -rf /var/lib/apt/lists/* + +# Install PostGIS extension in both versions of Postgres +RUN \ + POSTGIS_MAJOR=$(echo $POSTGIS_VERSION | cut -c1) && \ + apt update && \ + apt install -y --no-install-recommends \ + postgresql-$PG_MAJOR-postgis-$POSTGIS_MAJOR=$POSTGIS_VERSION* \ + postgresql-$PG_MAJOR-postgis-$POSTGIS_MAJOR-scripts && \ + rm -rf /var/lib/apt/lists/* \ No newline at end of file diff --git a/infra/docker/database/pg16_debian.Dockerfile b/infra/docker/database/pg16_debian.Dockerfile deleted file mode 100644 index 9e1d8fbb65..0000000000 --- a/infra/docker/database/pg16_debian.Dockerfile +++ /dev/null @@ -1,29 +0,0 @@ -ARG PG_MAJOR -ARG TIMESCALEDB_VERSION -ARG POSTGIS_VERSION - -FROM postgres:$PG_MAJOR-bookworm -ARG PG_MAJOR -ARG TIMESCALEDB_VERSION -ARG POSTGIS_VERSION - -# Install TimescaleDB extension in both versions of Postgres -RUN apt-get update -RUN apt-get install -y wget lsb-release -RUN echo "deb https://packagecloud.io/timescale/timescaledb/debian/ $(lsb_release -c -s) main" -RUN echo "deb https://packagecloud.io/timescale/timescaledb/debian/ $(lsb_release -c -s) main" > /etc/apt/sources.list.d/timescaledb.list -RUN wget --quiet -O - https://packagecloud.io/timescale/timescaledb/gpgkey | apt-key add - -RUN apt-get update - -RUN \ - TIMESCALEDB_MAJOR=$(echo $TIMESCALEDB_VERSION | cut -c1) && \ - apt-get install -y timescaledb-$TIMESCALEDB_MAJOR-postgresql-$PG_MAJOR=$TIMESCALEDB_VERSION* timescaledb-$TIMESCALEDB_MAJOR-loader-postgresql-$PG_MAJOR=$TIMESCALEDB_VERSION* - -# Install PostGIS extension in both versions of Postgres -RUN apt update -RUN \ - POSTGIS_MAJOR=$(echo $POSTGIS_VERSION | cut -c1) && \ - apt install -y --no-install-recommends \ - postgresql-$PG_MAJOR-postgis-$POSTGIS_MAJOR=$POSTGIS_VERSION* \ - postgresql-$PG_MAJOR-postgis-$POSTGIS_MAJOR-scripts \ - && rm -rf /var/lib/apt/lists/* \ No newline at end of file