From 797e6bd105f46d4a8704062d28dde68cf6c1304c Mon Sep 17 00:00:00 2001 From: Dan Lynch Date: Thu, 1 Jan 2026 14:45:15 +0000 Subject: [PATCH] Fix Dockerfile to compile all 4 extensions - Add perl, flex, bison build dependencies required by PostGIS - Add PG_TEXTSEARCH_VERSION ARG for consistency - Pin pg_textsearch to v0.2.0 - Fix missing math.h include in pg_textsearch (upstream bug) --- Dockerfile | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 095d567..19c16fa 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,6 +4,7 @@ ARG PG_VERSION=17 ARG PGVECTOR_VERSION=0.8.0 ARG POSTGIS_VERSION=3.5.1 +ARG PG_TEXTSEARCH_VERSION=0.2.0 ARG PGSODIUM_VERSION=3.1.9 ############################################# @@ -13,6 +14,7 @@ FROM postgres:${PG_VERSION}-alpine AS builder ARG PGVECTOR_VERSION ARG POSTGIS_VERSION +ARG PG_TEXTSEARCH_VERSION ARG PGSODIUM_VERSION RUN apk add --no-cache \ @@ -30,7 +32,11 @@ RUN apk add --no-cache \ protobuf-c-dev \ libxml2-dev \ pcre2-dev \ - libsodium-dev + libsodium-dev \ + # PostGIS build tools + perl \ + flex \ + bison WORKDIR /build @@ -51,8 +57,10 @@ RUN curl -L https://download.osgeo.org/postgis/source/postgis-${POSTGIS_VERSION} make install # pg_textsearch (BM25) -RUN git clone --depth 1 https://github.com/timescale/pg_textsearch.git && \ +RUN git clone --branch v${PG_TEXTSEARCH_VERSION} --depth 1 https://github.com/timescale/pg_textsearch.git && \ cd pg_textsearch && \ + # Fix missing math.h include (upstream bug) + sed -i '1i #include ' src/am/build.c && \ make -j$(nproc) && \ make install