Skip to content
This repository was archived by the owner on Apr 4, 2026. It is now read-only.

Commit b862a55

Browse files
authored
Add pgvector extension to all image variants (#1)
Build pgvector v0.8.0 from source in alpine and master templates. Install via apt package (postgresql-$PG_MAJOR-pgvector) in debian template. Verify CREATE EXTENSION vector in regression checks.
1 parent 8860ae1 commit b862a55

18 files changed

Lines changed: 100 additions & 0 deletions

File tree

13-3.5/alpine/Dockerfile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ LABEL maintainer="PostGIS Project - https://postgis.net" \
1212

1313
ENV POSTGIS_VERSION=3.5.5
1414
ENV POSTGIS_SHA256=fc3408c474662b5354c9569cfbd18172f2f4818c09945725b8d0089169925fb1
15+
ENV PGVECTOR_VERSION=0.8.0
1516

1617
RUN set -eux \
1718
&& apk add --no-cache --virtual .fetch-deps \
@@ -67,6 +68,12 @@ RUN set -eux \
6768
&& make -j${NPROC:-$(nproc)} \
6869
&& make install \
6970
\
71+
# build pgvector
72+
&& git clone --branch "v${PGVECTOR_VERSION}" --depth 1 https://github.com/pgvector/pgvector.git /usr/src/pgvector \
73+
&& cd /usr/src/pgvector \
74+
&& make -j${NPROC:-$(nproc)} \
75+
&& make install \
76+
\
7077
# This section is for refreshing the proj data for the regression tests.
7178
# It serves as a workaround for an issue documented at https://trac.osgeo.org/postgis/ticket/5316
7279
# This increases the Docker image size by about 1 MB.
@@ -90,6 +97,7 @@ RUN set -eux \
9097
&& su postgres -c 'psql -c "CREATE EXTENSION IF NOT EXISTS address_standardizer_data_us;"' \
9198
&& su postgres -c 'psql -c "CREATE EXTENSION IF NOT EXISTS postgis_tiger_geocoder;"' \
9299
&& su postgres -c 'psql -c "CREATE EXTENSION IF NOT EXISTS postgis_topology;"' \
100+
&& su postgres -c 'psql -c "CREATE EXTENSION IF NOT EXISTS vector;"' \
93101
&& su postgres -c 'psql -t -c "SELECT version();"' >> /_pgis_full_version.txt \
94102
&& su postgres -c 'psql -t -c "SELECT PostGIS_Full_Version();"' >> /_pgis_full_version.txt \
95103
&& su postgres -c 'psql -t -c "\dx"' >> /_pgis_full_version.txt \
@@ -117,6 +125,7 @@ RUN set -eux \
117125
# clean
118126
&& cd / \
119127
&& rm -rf /usr/src/postgis \
128+
&& rm -rf /usr/src/pgvector \
120129
&& apk del .fetch-deps .build-deps \
121130
# At the end of the build, we print the collected information
122131
# from the '/_pgis_full_version.txt' file. This is for experimental and internal purposes.

13-3.5/bullseye/Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ RUN apt-get update \
2020
\
2121
postgresql-$PG_MAJOR-postgis-$POSTGIS_MAJOR=$POSTGIS_VERSION \
2222
postgresql-$PG_MAJOR-postgis-$POSTGIS_MAJOR-scripts \
23+
postgresql-$PG_MAJOR-pgvector \
2324
&& rm -rf /var/lib/apt/lists/*
2425

2526
RUN mkdir -p /docker-entrypoint-initdb.d

14-3.5/alpine/Dockerfile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ LABEL maintainer="PostGIS Project - https://postgis.net" \
1212

1313
ENV POSTGIS_VERSION=3.5.5
1414
ENV POSTGIS_SHA256=fc3408c474662b5354c9569cfbd18172f2f4818c09945725b8d0089169925fb1
15+
ENV PGVECTOR_VERSION=0.8.0
1516

1617
RUN set -eux \
1718
&& apk add --no-cache --virtual .fetch-deps \
@@ -67,6 +68,12 @@ RUN set -eux \
6768
&& make -j${NPROC:-$(nproc)} \
6869
&& make install \
6970
\
71+
# build pgvector
72+
&& git clone --branch "v${PGVECTOR_VERSION}" --depth 1 https://github.com/pgvector/pgvector.git /usr/src/pgvector \
73+
&& cd /usr/src/pgvector \
74+
&& make -j${NPROC:-$(nproc)} \
75+
&& make install \
76+
\
7077
# This section is for refreshing the proj data for the regression tests.
7178
# It serves as a workaround for an issue documented at https://trac.osgeo.org/postgis/ticket/5316
7279
# This increases the Docker image size by about 1 MB.
@@ -90,6 +97,7 @@ RUN set -eux \
9097
&& su postgres -c 'psql -c "CREATE EXTENSION IF NOT EXISTS address_standardizer_data_us;"' \
9198
&& su postgres -c 'psql -c "CREATE EXTENSION IF NOT EXISTS postgis_tiger_geocoder;"' \
9299
&& su postgres -c 'psql -c "CREATE EXTENSION IF NOT EXISTS postgis_topology;"' \
100+
&& su postgres -c 'psql -c "CREATE EXTENSION IF NOT EXISTS vector;"' \
93101
&& su postgres -c 'psql -t -c "SELECT version();"' >> /_pgis_full_version.txt \
94102
&& su postgres -c 'psql -t -c "SELECT PostGIS_Full_Version();"' >> /_pgis_full_version.txt \
95103
&& su postgres -c 'psql -t -c "\dx"' >> /_pgis_full_version.txt \
@@ -117,6 +125,7 @@ RUN set -eux \
117125
# clean
118126
&& cd / \
119127
&& rm -rf /usr/src/postgis \
128+
&& rm -rf /usr/src/pgvector \
120129
&& apk del .fetch-deps .build-deps \
121130
# At the end of the build, we print the collected information
122131
# from the '/_pgis_full_version.txt' file. This is for experimental and internal purposes.

14-3.5/bullseye/Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ RUN apt-get update \
2020
\
2121
postgresql-$PG_MAJOR-postgis-$POSTGIS_MAJOR=$POSTGIS_VERSION \
2222
postgresql-$PG_MAJOR-postgis-$POSTGIS_MAJOR-scripts \
23+
postgresql-$PG_MAJOR-pgvector \
2324
&& rm -rf /var/lib/apt/lists/*
2425

2526
RUN mkdir -p /docker-entrypoint-initdb.d

15-3.5/alpine/Dockerfile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ LABEL maintainer="PostGIS Project - https://postgis.net" \
1212

1313
ENV POSTGIS_VERSION=3.5.5
1414
ENV POSTGIS_SHA256=fc3408c474662b5354c9569cfbd18172f2f4818c09945725b8d0089169925fb1
15+
ENV PGVECTOR_VERSION=0.8.0
1516

1617
RUN set -eux \
1718
&& apk add --no-cache --virtual .fetch-deps \
@@ -67,6 +68,12 @@ RUN set -eux \
6768
&& make -j${NPROC:-$(nproc)} \
6869
&& make install \
6970
\
71+
# build pgvector
72+
&& git clone --branch "v${PGVECTOR_VERSION}" --depth 1 https://github.com/pgvector/pgvector.git /usr/src/pgvector \
73+
&& cd /usr/src/pgvector \
74+
&& make -j${NPROC:-$(nproc)} \
75+
&& make install \
76+
\
7077
# This section is for refreshing the proj data for the regression tests.
7178
# It serves as a workaround for an issue documented at https://trac.osgeo.org/postgis/ticket/5316
7279
# This increases the Docker image size by about 1 MB.
@@ -90,6 +97,7 @@ RUN set -eux \
9097
&& su postgres -c 'psql -c "CREATE EXTENSION IF NOT EXISTS address_standardizer_data_us;"' \
9198
&& su postgres -c 'psql -c "CREATE EXTENSION IF NOT EXISTS postgis_tiger_geocoder;"' \
9299
&& su postgres -c 'psql -c "CREATE EXTENSION IF NOT EXISTS postgis_topology;"' \
100+
&& su postgres -c 'psql -c "CREATE EXTENSION IF NOT EXISTS vector;"' \
93101
&& su postgres -c 'psql -t -c "SELECT version();"' >> /_pgis_full_version.txt \
94102
&& su postgres -c 'psql -t -c "SELECT PostGIS_Full_Version();"' >> /_pgis_full_version.txt \
95103
&& su postgres -c 'psql -t -c "\dx"' >> /_pgis_full_version.txt \
@@ -117,6 +125,7 @@ RUN set -eux \
117125
# clean
118126
&& cd / \
119127
&& rm -rf /usr/src/postgis \
128+
&& rm -rf /usr/src/pgvector \
120129
&& apk del .fetch-deps .build-deps \
121130
# At the end of the build, we print the collected information
122131
# from the '/_pgis_full_version.txt' file. This is for experimental and internal purposes.

15-3.5/bullseye/Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ RUN apt-get update \
2020
\
2121
postgresql-$PG_MAJOR-postgis-$POSTGIS_MAJOR=$POSTGIS_VERSION \
2222
postgresql-$PG_MAJOR-postgis-$POSTGIS_MAJOR-scripts \
23+
postgresql-$PG_MAJOR-pgvector \
2324
&& rm -rf /var/lib/apt/lists/*
2425

2526
RUN mkdir -p /docker-entrypoint-initdb.d

16-3.5/alpine/Dockerfile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ LABEL maintainer="PostGIS Project - https://postgis.net" \
1212

1313
ENV POSTGIS_VERSION=3.5.5
1414
ENV POSTGIS_SHA256=fc3408c474662b5354c9569cfbd18172f2f4818c09945725b8d0089169925fb1
15+
ENV PGVECTOR_VERSION=0.8.0
1516

1617
RUN set -eux \
1718
&& apk add --no-cache --virtual .fetch-deps \
@@ -67,6 +68,12 @@ RUN set -eux \
6768
&& make -j${NPROC:-$(nproc)} \
6869
&& make install \
6970
\
71+
# build pgvector
72+
&& git clone --branch "v${PGVECTOR_VERSION}" --depth 1 https://github.com/pgvector/pgvector.git /usr/src/pgvector \
73+
&& cd /usr/src/pgvector \
74+
&& make -j${NPROC:-$(nproc)} \
75+
&& make install \
76+
\
7077
# This section is for refreshing the proj data for the regression tests.
7178
# It serves as a workaround for an issue documented at https://trac.osgeo.org/postgis/ticket/5316
7279
# This increases the Docker image size by about 1 MB.
@@ -90,6 +97,7 @@ RUN set -eux \
9097
&& su postgres -c 'psql -c "CREATE EXTENSION IF NOT EXISTS address_standardizer_data_us;"' \
9198
&& su postgres -c 'psql -c "CREATE EXTENSION IF NOT EXISTS postgis_tiger_geocoder;"' \
9299
&& su postgres -c 'psql -c "CREATE EXTENSION IF NOT EXISTS postgis_topology;"' \
100+
&& su postgres -c 'psql -c "CREATE EXTENSION IF NOT EXISTS vector;"' \
93101
&& su postgres -c 'psql -t -c "SELECT version();"' >> /_pgis_full_version.txt \
94102
&& su postgres -c 'psql -t -c "SELECT PostGIS_Full_Version();"' >> /_pgis_full_version.txt \
95103
&& su postgres -c 'psql -t -c "\dx"' >> /_pgis_full_version.txt \
@@ -117,6 +125,7 @@ RUN set -eux \
117125
# clean
118126
&& cd / \
119127
&& rm -rf /usr/src/postgis \
128+
&& rm -rf /usr/src/pgvector \
120129
&& apk del .fetch-deps .build-deps \
121130
# At the end of the build, we print the collected information
122131
# from the '/_pgis_full_version.txt' file. This is for experimental and internal purposes.

16-3.5/bullseye/Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ RUN apt-get update \
2020
\
2121
postgresql-$PG_MAJOR-postgis-$POSTGIS_MAJOR=$POSTGIS_VERSION \
2222
postgresql-$PG_MAJOR-postgis-$POSTGIS_MAJOR-scripts \
23+
postgresql-$PG_MAJOR-pgvector \
2324
&& rm -rf /var/lib/apt/lists/*
2425

2526
RUN mkdir -p /docker-entrypoint-initdb.d

16-master/bullseye/Dockerfile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -394,6 +394,11 @@ RUN set -ex \
394394
--enable-lto \
395395
&& make -j${NPROC:-$(nproc)} \
396396
&& make install \
397+
# build pgvector
398+
&& git clone --branch v0.8.0 --depth 1 https://github.com/pgvector/pgvector.git /usr/src/pgvector \
399+
&& cd /usr/src/pgvector \
400+
&& make -j${NPROC:-$(nproc)} \
401+
&& make install \
397402
# refresh proj data - workarounds: https://trac.osgeo.org/postgis/ticket/5316
398403
&& projsync --system-directory --file ch_swisstopo_CHENyx06_ETRS \
399404
&& projsync --system-directory --file us_noaa_eshpgn \
@@ -416,6 +421,7 @@ RUN set -ex \
416421
&& su postgres -c 'psql -c "CREATE EXTENSION IF NOT EXISTS address_standardizer_data_us;"' \
417422
&& su postgres -c 'psql -c "CREATE EXTENSION IF NOT EXISTS postgis_tiger_geocoder;"' \
418423
&& su postgres -c 'psql -c "CREATE EXTENSION IF NOT EXISTS postgis_topology;"' \
424+
&& su postgres -c 'psql -c "CREATE EXTENSION IF NOT EXISTS vector;"' \
419425
&& su postgres -c 'psql -t -c "SELECT version();"' >> /_pgis_full_version.txt \
420426
&& su postgres -c 'psql -t -c "SELECT PostGIS_Full_Version();"' >> /_pgis_full_version.txt \
421427
&& su postgres -c 'psql -t -c "\dx"' >> /_pgis_full_version.txt \
@@ -427,6 +433,7 @@ RUN set -ex \
427433
# clean
428434
&& cd / \
429435
&& rm -rf /usr/src/postgis \
436+
&& rm -rf /usr/src/pgvector \
430437
&& apt-get purge -y --autoremove \
431438
autoconf \
432439
automake \

17-3.5/alpine/Dockerfile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ LABEL maintainer="PostGIS Project - https://postgis.net" \
1212

1313
ENV POSTGIS_VERSION=3.5.5
1414
ENV POSTGIS_SHA256=fc3408c474662b5354c9569cfbd18172f2f4818c09945725b8d0089169925fb1
15+
ENV PGVECTOR_VERSION=0.8.0
1516

1617
RUN set -eux \
1718
&& apk add --no-cache --virtual .fetch-deps \
@@ -67,6 +68,12 @@ RUN set -eux \
6768
&& make -j${NPROC:-$(nproc)} \
6869
&& make install \
6970
\
71+
# build pgvector
72+
&& git clone --branch "v${PGVECTOR_VERSION}" --depth 1 https://github.com/pgvector/pgvector.git /usr/src/pgvector \
73+
&& cd /usr/src/pgvector \
74+
&& make -j${NPROC:-$(nproc)} \
75+
&& make install \
76+
\
7077
# This section is for refreshing the proj data for the regression tests.
7178
# It serves as a workaround for an issue documented at https://trac.osgeo.org/postgis/ticket/5316
7279
# This increases the Docker image size by about 1 MB.
@@ -90,6 +97,7 @@ RUN set -eux \
9097
&& su postgres -c 'psql -c "CREATE EXTENSION IF NOT EXISTS address_standardizer_data_us;"' \
9198
&& su postgres -c 'psql -c "CREATE EXTENSION IF NOT EXISTS postgis_tiger_geocoder;"' \
9299
&& su postgres -c 'psql -c "CREATE EXTENSION IF NOT EXISTS postgis_topology;"' \
100+
&& su postgres -c 'psql -c "CREATE EXTENSION IF NOT EXISTS vector;"' \
93101
&& su postgres -c 'psql -t -c "SELECT version();"' >> /_pgis_full_version.txt \
94102
&& su postgres -c 'psql -t -c "SELECT PostGIS_Full_Version();"' >> /_pgis_full_version.txt \
95103
&& su postgres -c 'psql -t -c "\dx"' >> /_pgis_full_version.txt \
@@ -117,6 +125,7 @@ RUN set -eux \
117125
# clean
118126
&& cd / \
119127
&& rm -rf /usr/src/postgis \
128+
&& rm -rf /usr/src/pgvector \
120129
&& apk del .fetch-deps .build-deps \
121130
# At the end of the build, we print the collected information
122131
# from the '/_pgis_full_version.txt' file. This is for experimental and internal purposes.

0 commit comments

Comments
 (0)