postgre-with-ext/Dockerfile
2025-02-17 07:38:19 +08:00

40 lines
1.6 KiB
Docker

ARG PG_MAJOR=17
FROM postgres:$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
# 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-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 && \
# 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 cmake postgresql-server-dev-$PG_MAJOR
# PG VECTOR
# COPY pgvector /tmp/build/pgvector
# RUN cd /tmp/build/pgvector && \
# make clean && \
# make OPTFLAGS="" && \
# make install && \
# mkdir /usr/share/doc/pgvector && \
# cp LICENSE README.md /usr/share/doc/pgvector
# # TIMESCALE
# COPY timescaledb /tmp/build/timescaledb
# RUN cd /tmp/build/timescaledb && ./bootstrap && cd build && make && make install
# CLEAN
# RUN rm -rf /tmp/build && \
# apt-get autoremove --purge -y build-essential git postgresql-server-dev-$PG_MAJOR && \
# apt-mark unhold locales && \
# rm -rf /var/lib/apt/lists/*