更精简

This commit is contained in:
ivamp 2025-02-17 07:38:19 +08:00
parent c4ee385594
commit ebbc75b38c
4 changed files with 28 additions and 34 deletions

View File

@ -1,35 +1,40 @@
ARG PG_MAJOR=16 ARG PG_MAJOR=17
FROM postgres:$PG_MAJOR FROM postgres:$PG_MAJOR
ARG PG_MAJOR ARG PG_MAJOR
# why no apt
RUN apt update && \
apt install -y postgresql-$PG_MAJOR-timescaledb postgresql-$PG_MAJOR-age postgresql-$PG_MAJOR-pgvector && \
rm -rf /var/lib/apt/lists/*
# Base # Base
RUN echo "deb http://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm main contrib non-free non-free-firmware" > /etc/apt/sources.list && \ # 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 && \ # echo "deb http://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-updates main contrib non-free non-free-firmware" >> /etc/apt/sources.list && \
echo "deb http://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-backports main contrib non-free non-free-firmware" >> /etc/apt/sources.list && \ # echo "deb http://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-backports main contrib non-free non-free-firmware" >> /etc/apt/sources.list && \
echo "deb http://mirrors.tuna.tsinghua.edu.cn/debian-security bookworm-security main contrib non-free non-free-firmware" >> /etc/apt/sources.list && \ # echo "deb http://mirrors.tuna.tsinghua.edu.cn/debian-security bookworm-security main contrib non-free non-free-firmware" >> /etc/apt/sources.list && \
rm -rf /etc/apt/sources.list.d/debian.sources && \ # rm -rf /etc/apt/sources.list.d/debian.sources && \
mkdir -p /tmp/build && apt-get update && \ # mkdir -p /tmp/build && apt-get update && \
apt-mark hold locales && \ # apt-mark hold locales && \
apt-get install -y --no-install-recommends build-essential cmake postgresql-server-dev-$PG_MAJOR # apt-get install -y --no-install-recommends build-essential cmake postgresql-server-dev-$PG_MAJOR
# PG VECTOR # PG VECTOR
COPY pgvector /tmp/build/pgvector # COPY pgvector /tmp/build/pgvector
RUN cd /tmp/build/pgvector && \ # RUN cd /tmp/build/pgvector && \
make clean && \ # make clean && \
make OPTFLAGS="" && \ # make OPTFLAGS="" && \
make install && \ # make install && \
mkdir /usr/share/doc/pgvector && \ # mkdir /usr/share/doc/pgvector && \
cp LICENSE README.md /usr/share/doc/pgvector # cp LICENSE README.md /usr/share/doc/pgvector
# TIMESCALE # # TIMESCALE
COPY timescaledb /tmp/build/timescaledb # COPY timescaledb /tmp/build/timescaledb
RUN cd /tmp/build/timescaledb && ./bootstrap && cd build && make && make install # RUN cd /tmp/build/timescaledb && ./bootstrap && cd build && make && make install
# CLEAN # CLEAN
RUN rm -r /tmp/build && \ # RUN rm -rf /tmp/build && \
apt-get autoremove --purge -y build-essential git postgresql-server-dev-$PG_MAJOR && \ # apt-get autoremove --purge -y build-essential git postgresql-server-dev-$PG_MAJOR && \
apt-mark unhold locales && \ # apt-mark unhold locales && \
rm -rf /var/lib/apt/lists/* # rm -rf /var/lib/apt/lists/*

@ -1 +0,0 @@
Subproject commit 3849f0fd3d6f7916de26d43e3a3c9f8e6615bc8f

View File

@ -1,9 +0,0 @@
#!/bin/bash
git clone https://github.com/pgvector/pgvector
cd pgvector && git checkout v0.7.0
cd ..
git clone https://github.com/timescale/timescaledb
cd timescaledb && git checkout 2.15.0

@ -1 +0,0 @@
Subproject commit f9ccf1be07760b77cf1faf3e639a960b9d229399