This commit is contained in:
ivamp 2024-05-06 20:57:55 +08:00
parent dce02e74d4
commit 472dca3011

View File

@ -1,6 +1,8 @@
ARG PG_MAJOR=16
FROM postgres:$PG_MAJOR
ARG PG_MAJOR
# Base
RUN echo "deb http://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm main contrib non-free non-free-firmware" > /etc/apt/sources.list && \
echo "deb http://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-updates main contrib non-free non-free-firmware" >> /etc/apt/sources.list && \
@ -9,11 +11,12 @@ RUN echo "deb http://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm main contrib
rm -rf /etc/apt/sources.list.d/debian.sources && \
mkdir -p /tmp/build && apt-get update && \
apt-mark hold locales && \
apt-get install -y --no-install-recommends build-essential git postgresql-server-dev-$PG_MAJOR
apt-get install -y --no-install-recommends build-essential git cmake postgresql-server-dev-$PG_MAJOR
# PG VECTOR
RUN git clone https://github.com/pgvector/pgvector /tmp/build/pgvector && cd /tmp/build/pgvector && \
COPY pgvector /tmp/build/pgvector
RUN cd /tmp/build/pgvector && \
make clean && \
make OPTFLAGS="" && \
make install && \
@ -22,8 +25,8 @@ RUN git clone https://github.com/pgvector/pgvector /tmp/build/pgvector && cd /tm
# TIMESCALE
RUN git clone https://github.com/timescale/timescaledb /tmp/build/timescaledb && cd /tmp/build/timescaledb && \
git checkout 2.14.2 && ./bootstrap && cd build && make && make install
COPY timescaledb /tmp/build/timescaledb
RUN cd /tmp/build/timescaledb && git checkout . && git checkout 2.14.2 && ./bootstrap && cd build && make && make install
# CLEAN
RUN rm -r /tmp/build && \