11ARG PG_VERSION
22ARG PREV_IMAGE
33ARG TS_VERSION
4- ARG PG_MAJOR=15
5- ARG GO_VERSION=1.18.7
6- ARG OSS_ONLY
7-
84# ###########################
95# Build tools binaries in separate image
106# ###########################
7+ ARG GO_VERSION=1.18.7
118FROM golang:${GO_VERSION}-alpine AS tools
129
1310ENV TOOLS_VERSION 0.8.1
@@ -19,7 +16,10 @@ RUN apk update && apk add --no-cache git gcc musl-dev \
1916# ###########################
2017# Grab old versions from previous version
2118# ###########################
19+ ARG PG_VERSION
20+ ARG PREV_IMAGE
2221FROM ${PREV_IMAGE} AS oldversions
22+ # Remove update files, mock files, and all but the last 5 .so/.sql files
2323RUN rm -f $(pg_config --sharedir)/extension/timescaledb*mock*.sql \
2424 && if [ -f $(pg_config --pkglibdir)/timescaledb-tsl-1*.so ]; then rm -f $(ls -1 $(pg_config --pkglibdir)/timescaledb-tsl-1*.so | head -n -5); fi \
2525 && if [ -f $(pg_config --pkglibdir)/timescaledb-1*.so ]; then rm -f $(ls -1 $(pg_config --pkglibdir)/timescaledb-*.so | head -n -5); fi \
@@ -28,7 +28,9 @@ RUN rm -f $(pg_config --sharedir)/extension/timescaledb*mock*.sql \
2828# ###########################
2929# Now build image and copy in tools
3030# ###########################
31- FROM postgres:${PG_MAJOR}-alpine
31+ ARG PG_VERSION
32+ FROM postgres:${PG_VERSION}-alpine
33+ ARG OSS_ONLY
3234
3335LABEL maintainer="Timescale https://www.timescale.com"
3436
@@ -37,6 +39,7 @@ COPY --from=tools /go/bin/* /usr/local/bin/
3739COPY --from=oldversions /usr/local/lib/postgresql/timescaledb-*.so /usr/local/lib/postgresql/
3840COPY --from=oldversions /usr/local/share/postgresql/extension/timescaledb--*.sql /usr/local/share/postgresql/extension/
3941
42+ ARG TS_VERSION
4043RUN set -ex \
4144 && apk add libssl1.1 \
4245 && apk add --no-cache --virtual .fetch-deps \
@@ -67,4 +70,26 @@ RUN set -ex \
6770 \
6871 && if [ "${OSS_ONLY}" != "" ]; then rm -f $(pg_config --pkglibdir)/timescaledb-tsl-*.so; fi \
6972 && apk del .fetch-deps .build-deps \
70- && rm
73+ && rm -rf /build \
74+ && sed -r -i "s/[#]*\s *(shared_preload_libraries)\s *=\s *'(.*)'/\1 = 'timescaledb,\2 '/;s/,'/'/" /usr/local/share/postgresql/postgresql.conf.sample
75+
76+ # Adding PG Vector
77+
78+ RUN cd /tmp
79+ RUN apk add --no-cache --virtual .build-deps \
80+ coreutils \
81+ dpkg-dev dpkg \
82+ gcc \
83+ git \
84+ krb5-dev \
85+ libc-dev \
86+ llvm15 \
87+ clang \
88+ make \
89+ cmake \
90+ util-linux-dev \
91+ && git clone --branch v0.4.1 https://github.com/pgvector/pgvector.git \
92+ && cd /pgvector \
93+ && ls \
94+ && make \
95+ && make install
0 commit comments