Skip to content

Instantly share code, notes, and snippets.

@iosifnicolae2
Created March 26, 2024 11:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save iosifnicolae2/3c7896c16506828621f4530845ec2cb1 to your computer and use it in GitHub Desktop.
Save iosifnicolae2/3c7896c16506828621f4530845ec2cb1 to your computer and use it in GitHub Desktop.
Crunchy database custom postgresql
FROM registry.developers.crunchydata.com/crunchydata/crunchy-postgres-gis:ubi8-14.10-3.3-0
ARG PG_MAJOR=14
ARG POSTGRESQL_SERVER_DEVEL=postgresql${PG_MAJOR}-devel
ARG PACKAGER=microdnf
USER 0
ADD https://api.developers.crunchydata.com/downloads/repo/rpm-centos/postgresql14/crunchypg14.repo /etc/yum.repos.d/crunchypg14.repo
ADD https://api.developers.crunchydata.com/downloads/gpg/RPM-GPG-KEY-crunchydata-dev /etc/pki/rpm-gpg
## Install yum
RUN ${PACKAGER} install -y yum rpm
## Install requirements
RUN yum install "$POSTGRESQL_SERVER_DEVEL" --allowerasing -y \
&& yum install -y \
nss_wrapper git wget ca-certificates make gcc gcc-c++ autoconf libtool compiler-rt \
pkg-config openssl-devel libcurl-devel libmetalink libuuid-devel
RUN pip3 install requests;
RUN if [ "$HTTP_PROXY_ENABLED" = "true" ]; then \
git config --global http.proxy $HTTP_PROXY \
&& git config --global https.proxy $HTTPS_PROXY; \
fi;
## Install mongo_fdw
RUN #git config --global url."https://github.com/".insteadOf git://github.com/ \
# && git clone --recursive https://github.com/EnterpriseDB/mongo_fdw.git /tmp/mongo_fdw \
# && cd /tmp/mongo_fdw \
# && ./autogen.sh --with-master \
# && export MAJORVERSION=${PG_MAJOR} \
# && make \
# && make install \
# && cd / \
# && rm -rf /tmp/mongo_fdw
## Install clickhouse_fdw
RUN echo "Installing clickhouse_fdw-v1.3.1-18" && git clone https://github.com/iosifnicolae2/clickhouse_fdw.git \
&& cd clickhouse_fdw \
&& mkdir build && cd build \
&& cmake -DCMAKE_C_COMPILER=/usr/bin/gcc -DCMAKE_CXX_COMPILER=/usr/bin/g++ .. \
&& make \
&& make install
## Cleaning
RUN yum remove -y \
git wget make "$POSTGRESQL_SERVER_DEVEL" \
&& yum autoremove -y \
&& yum clean all -y \
&& rm -rf /var/lib/apt/lists/*
USER 26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment