mirror of
https://github.com/dredx/prole.git
synced 2026-09-24 13:14:32 +00:00
138 lines
6.0 KiB
Docker
138 lines
6.0 KiB
Docker
FROM debian:bookworm-slim
|
|
|
|
RUN apt-get update && apt-get install -y curl gpg sudo lsb-release ca-certificates wget
|
|
RUN echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list
|
|
RUN curl -fsSL https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo gpg --dearmor -o /etc/apt/trusted.gpg.d/postgresql.gpg
|
|
RUN apt-get update && apt-get install -y build-essential make gcc pkg-config clang gettext autoconf automake libssl-dev
|
|
|
|
# install nfs & iscsi
|
|
RUN apt-get install -y nfs-common
|
|
RUN apt-get install -y open-iscsi
|
|
|
|
# postgresql build libs
|
|
RUN apt-get install -y python3 python3-dev libpython3-dev python3-postgresql postgresql-plpython3-17
|
|
RUN apt-get install -y perl perl-tk libgtk3-perl libperl-dev less dialog
|
|
RUN apt-get install -y tcl tcllib tcl-dev postgresql-pltcl-17
|
|
RUN apt-get install -y postgis postgresql-postgis postgresql-postgis-scripts postgresql-17-postgis-3 postgresql-17-postgis-3
|
|
RUN apt-get install -y pkg-config bison flex libicu-dev icu-devtools readline-common libreadline-dev libreadline-java rlwrap
|
|
RUN apt-get install -y libpam-modules libpam-modules-bin python3-pam python3-pampy
|
|
RUN apt-get install -y llvm-19 llvm-dev lld libclang-dev clang clang-19 clang-tools
|
|
RUN apt-get install -y net-tools iputils-ping iputils-tracepath iputils-clockdiff iputils-arping
|
|
RUN apt-get install -y postgresql-server-dev-17 libssl-dev
|
|
|
|
# postgresql install
|
|
RUN apt-get install -y postgresql-17
|
|
ENV PATH=$PATH:/usr/lib/postgresql/17/bin
|
|
|
|
# postgresql-17 extensions; including postgis and foreign data wrappers
|
|
RUN apt-get install -y -V libsybdb5 freetds-dev freetds-common # tds file support for Sybase and Microsoft SQL Server
|
|
RUN apt-get install -y --no-install-recommends \
|
|
postgresql-17-pgvector \
|
|
postgresql-17-pgaudit \
|
|
postgresql-17-pg-failover-slots \
|
|
postgresql-17-pglogical \
|
|
postgresql-17-timescaledb \
|
|
postgresql-17-mysql-fdw \
|
|
postgresql-17-oracle-fdw \
|
|
postgresql-17-orafce \
|
|
postgresql-17-pgl-ddl-deploy \
|
|
postgresql-17-pg-hint-plan \
|
|
postgresql-17-pgpool2 \
|
|
postgresql-17-pgrouting \
|
|
postgresql-17-pg-stat-kcache \
|
|
postgresql-17-pg-wait-sampling \
|
|
postgresql-17-powa \
|
|
postgresql-17-plr \
|
|
postgresql-17-show-plans \
|
|
postgresql-17-slony1-2 \
|
|
postgresql-17-tds-fdw \
|
|
postgresql-client-17
|
|
|
|
# apache arrow
|
|
RUN wget https://packages.apache.org/artifactory/arrow/$(lsb_release --id --short | tr 'A-Z' 'a-z')/apache-arrow-apt-source-latest-$(lsb_release --codename --short).deb
|
|
RUN apt install -y -V ./apache-arrow-apt-source-latest-$(lsb_release --codename --short).deb
|
|
RUN apt update
|
|
RUN apt install -y -V libarrow-dev # For C++
|
|
RUN apt install -y -V libarrow-glib-dev # For GLib (C)
|
|
RUN apt install -y -V libarrow-dataset-dev # For Apache Arrow Dataset C++
|
|
RUN apt install -y -V libarrow-dataset-glib-dev # For Apache Arrow Dataset GLib (C)
|
|
RUN apt install -y -V libarrow-acero-dev # For Apache Arrow Acero
|
|
RUN apt install -y -V libarrow-flight-dev # For Apache Arrow Flight C++
|
|
RUN apt install -y -V libarrow-flight-glib-dev # For Apache Arrow Flight GLib (C)
|
|
RUN apt install -y -V libarrow-flight-sql-dev # For Apache Arrow Flight SQL C++
|
|
RUN apt install -y -V libarrow-flight-sql-glib-dev # For Apache Arrow Flight SQL GLib (C)
|
|
RUN apt install -y -V libgandiva-dev # For Gandiva C++
|
|
RUN apt install -y -V libgandiva-glib-dev # For Gandiva GLib (C)
|
|
RUN apt install -y -V libparquet-dev # For Apache Parquet C++
|
|
RUN apt install -y -V libparquet-glib-dev # For Apache Parquet GLib (C)
|
|
|
|
ENV PGDATA=/var/lib/postgresql/data
|
|
RUN install --verbose --directory --owner postgres --group postgres --mode 3777 /var/run/postgresql
|
|
RUN install --verbose --directory --owner postgres --group postgres --mode 1777 "$PGDATA"
|
|
VOLUME /var/lib/postgresql/data
|
|
|
|
# gosu - postgres
|
|
RUN apt-get install -y gosu
|
|
|
|
# make the "en_US.UTF-8" locale so postgres will be utf-8 enabled by default
|
|
RUN set -eux; \
|
|
if [ -f /etc/dpkg/dpkg.cfg.d/docker ]; then \
|
|
# if this file exists, we're likely in "debian:xxx-slim", and locales are thus being excluded so we need to remove that exclusion (since we need locales)
|
|
grep -q '/usr/share/locale' /etc/dpkg/dpkg.cfg.d/docker; \
|
|
sed -ri '/\/usr\/share\/locale/d' /etc/dpkg/dpkg.cfg.d/docker; \
|
|
! grep -q '/usr/share/locale' /etc/dpkg/dpkg.cfg.d/docker; \
|
|
fi; \
|
|
apt-get update; apt-get install -y --no-install-recommends locales; rm -rf /var/lib/apt/lists/*; \
|
|
echo 'en_US.UTF-8 UTF-8' >> /etc/locale.gen; \
|
|
locale-gen; \
|
|
locale -a | grep 'en_US.utf8'
|
|
ENV LANG=en_US.utf8
|
|
|
|
RUN set -eux; \
|
|
apt-get update; \
|
|
apt-get install -y --no-install-recommends \
|
|
libnss-wrapper \
|
|
xz-utils \
|
|
zstd \
|
|
; \
|
|
rm -rf /var/lib/apt/lists/*
|
|
|
|
RUN mkdir /docker-entrypoint-initdb.d
|
|
|
|
# Install barman-cloud
|
|
COPY requirements.txt /
|
|
RUN set -xe; \
|
|
apt-get update; \
|
|
apt-get install -y --no-install-recommends \
|
|
# We require build-essential and python3-dev to build lz4 on arm64 since there isn't a pre-compiled wheel available
|
|
build-essential python3-dev \
|
|
python3-pip \
|
|
python3-psycopg2 \
|
|
python3-setuptools \
|
|
; \
|
|
pip3 install --break-system-packages --upgrade pip; \
|
|
# TODO: Remove --no-deps once https://github.com/pypa/pip/issues/9644 is solved
|
|
pip3 install --break-system-packages --no-deps -r requirements.txt; \
|
|
apt-get remove -y --purge --autoremove build-essential python3-dev; \
|
|
rm -rf /var/lib/apt/lists/*;
|
|
|
|
ENV PG_MAJOR=17
|
|
ENV PATH=$PATH:/usr/lib/postgresql/$PG_MAJOR/bin`
|
|
|
|
COPY docker-entrypoint.sh docker-ensure-initdb.sh /usr/local/bin/
|
|
RUN ln -sT docker-ensure-initdb.sh /usr/local/bin/docker-enforce-initdb.sh
|
|
ENTRYPOINT ["docker-entrypoint.sh"]
|
|
|
|
# Change the uid of postgres to 26
|
|
RUN usermod -u 26 postgres
|
|
RUN chown -R postgres:postgres /etc/postgresql
|
|
RUN chown -R postgres:postgres /var/lib/postgresql
|
|
RUN chown -R postgres:postgres /var/log/postgresql
|
|
RUN chown postgres:postgres /var/run/postgresql
|
|
USER 26
|
|
|
|
STOPSIGNAL SIGINT
|
|
|
|
EXPOSE 5432
|
|
CMD ["postgres"]
|