Skip to content

Commit

Permalink
Compiled Postgis 2.5.1 myself because of an upgrade bug in RC5
Browse files Browse the repository at this point in the history
  • Loading branch information
expaso committed Jan 9, 2025
1 parent 09c3fc3 commit adbba82
Show file tree
Hide file tree
Showing 3 changed files with 82 additions and 2 deletions.
2 changes: 1 addition & 1 deletion project.sh
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,6 @@ function build_all() {
./timescaledb \
&& printInColor "Done building docker image!" "green"
done

}

# Builds a dev tagged image locally
Expand Down Expand Up @@ -188,6 +187,7 @@ elif [ "$1" == "build-dependencies" ]; then
build_dependency timescaledb-toolkit-pg17 "1.19.0"
build_dependency postgis-pg15 "3.5.1"
build_dependency postgis-pg16 "3.5.1"
build_dependency postgis-pg17 "3.5.1"
build_dependency postgresql-extension-system-stat-pg16 "3.2"
build_dependency postgresql-extension-system-stat-pg17 "3.2"
else
Expand Down
12 changes: 11 additions & 1 deletion timescaledb/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ FROM ghcr.io/expaso/timescaledb/dependency/pgagent-pg16:REL-4_2_2
FROM ghcr.io/expaso/timescaledb/dependency/pgagent-pg17:REL-4_2_2 AS pgagent-pg17
FROM ghcr.io/expaso/timescaledb/dependency/postgis-pg15:3.5.1 AS postgis-pg15
FROM ghcr.io/expaso/timescaledb/dependency/postgis-pg16:3.5.1 AS postgis-pg16
FROM ghcr.io/expaso/timescaledb/dependency/postgis-pg17:3.5.1 AS postgis-pg17
FROM ghcr.io/expaso/timescaledb/dependency/timescaledb-toolkit-pg16:1.19.0 AS timescaledb-toolkit-pg16
FROM ghcr.io/expaso/timescaledb/dependency/timescaledb-toolkit-pg17:1.19.0 AS timescaledb-toolkit-pg17
FROM ghcr.io/expaso/timescaledb/dependency/postgresql-extension-system-stat-pg16:3.2 AS system-stat-pg16
Expand Down Expand Up @@ -153,12 +154,21 @@ RUN --mount=type=cache,id=apk-${TARGETARCH}-${TARGETVARIANT},sharing=locked,targ
RUN --mount=type=cache,id=apk-${TARGETARCH}-${TARGETVARIANT},sharing=locked,target=/var/cache/apk \

Check failure on line 154 in timescaledb/Dockerfile

View workflow job for this annotation

GitHub Actions / workflows / Hadolint

DL3019 info: Use the `--no-cache` switch to avoid the need to use `--update` and remove `/var/cache/apk/*` when done installing packages
set -ex \
&& apk add --repository https://dl-cdn.alpinelinux.org/alpine/v3.21/community --allow-untrusted \
postgis=3.5.0-r5 \
#postgis=3.5.0-r5 \
gdal-driver-postgisraster \
&& \
apk add --repository https://dl-cdn.alpinelinux.org/alpine/v3.21/main \
libturbojpeg

# Postgis + Postgis-Raster
COPY --from=postgis-pg17 --link /usr/local/lib/postgresql/postgis* /usr/lib/postgresql17/

COPY --from=postgis-pg17 --link /usr/local/lib/postgresql/bitcode/postgis-3/* /usr/lib/postgresql17/bitcode/postgis-3/
COPY --from=postgis-pg17 --link /usr/local/lib/postgresql/bitcode/postgis_raster-3/* /usr/lib/postgresql17/bitcode/postgis_raster-3/

COPY --from=postgis-pg17 --link /usr/local/share/postgresql/contrib/postgis* /usr/share/postgresql17/contrib/
COPY --from=postgis-pg17 --link /usr/local/share/postgresql/extension/postgis* /usr/share/postgresql17/extension/

# -----------------------------------------
# Extension Timescale pg-15 (old)
# -----------------------------------------
Expand Down
70 changes: 70 additions & 0 deletions timescaledb/docker-dependencies/postgis-pg17
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@

FROM timescale/timescaledb:latest-pg17 AS timescale-pg17

# --------------------------------------
# PostGIS - Build and install OLD Postgis (for upgrade reasons)
# --------------------------------------
ARG VERSION
ARG TARGETARCH
ARG TARGETVARIANT

# PostGIS - Add required packages for runtime (see postgis dependencies)
# hadolint ignore=DL3018
RUN --mount=type=cache,id=apk-${TARGETARCH}-${TARGETVARIANT},sharing=locked,target=/var/cache/apk \
set -ex \
&& apk update \
&& apk add \
openexr \
poppler \
gdal \
geos \
json-c \
libgcc \
libpq \
libstdc++ \
libxml2 \
musl \
pcre \
perl \
proj \
protobuf-c

# hadolint ignore=DL3018, DL3003
RUN --mount=type=cache,id=apk-${TARGETARCH}-${TARGETVARIANT},sharing=locked,target=/var/cache/apk \
set -ex \
&& apk update \
&& apk add --virtual .fetch-deps \
ca-certificates \
git \
openssl \
openssl-dev \
tar \
wget \
&& mkdir -p /build/ \
&& wget --progress=dot:giga -P /build https://download.osgeo.org/postgis/source/postgis-${VERSION}.tar.gz \
&& apk add --virtual .build-deps \
coreutils \
gcc \
make \
cmake \
build-base \
libxml2-dev \
protobuf-c-dev \
clang19 \
llvm19 \
&& apk add --virtual .community-build-deps \
geos-dev \
proj-dev \
gdal-dev \
&& cd /build \
&& tar xvzf postgis-${VERSION}.tar.gz \
&& cd /build/postgis-${VERSION} \
&& ./configure --with-pgconfig=/usr/local/bin/pg_config \
&& make && make install \
&& cd ~ \
&& apk del .fetch-deps .build-deps .community-build-deps \
&& rm -rf /build

# Labels
LABEL \
org.opencontainers.image.source="https://github.com/expaso/hassos-addon-timescaledb"

0 comments on commit adbba82

Please sign in to comment.