CrunchyData / crunchy-containers

Containers for Managing PostgreSQL on Kubernetes by Crunchy Data
https://www.crunchydata.com/
Apache License 2.0
1.01k stars 328 forks source link

mongo_fdw extension #1436

Closed iosifnicolae2 closed 2 years ago

iosifnicolae2 commented 2 years ago

If you need to install mongo_fdw extension you can build you can extend the Docker image using the below file:

FROM registry.developers.crunchydata.com/crunchydata/crunchy-postgres-gis:ubi8-14.2-3.1-1

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

## Install mongo_fdw
RUN yum install "$POSTGRESQL_SERVER_DEVEL" --allowerasing -y \
    && yum install -y \
    nss_wrapper git wget ca-certificates make gcc autoconf libtool \
    pkg-config openssl-devel \
  && 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 \
  && yum remove -y \
    git wget make "$POSTGRESQL_SERVER_DEVEL" \
  && yum autoremove -y \
  && yum clean all -y \
  && rm -rf /var/lib/apt/lists/*

USER 26
iosifnicolae2 commented 2 years ago

yum install "$POSTGRESQL_SERVER_DEVEL" gives the following error, we've managed to solve it using --allowerasing but i don't know if it's recommended to use it..

error: Could not depsolve transaction; 1 problem detected:
 Problem: problem with installed package postgresql14-llvmjit-14.2-0Crunchy.el8.x86_64
  - package postgresql14-llvmjit-14.2-0Crunchy.el8.x86_64 requires postgresql14-server(x86-64) = 14.2-0Crunchy.el8, but none of the providers can be installed
  - package postgresql14-llvmjit-14.1-1Crunchy.el8.centos.x86_64 requires postgresql14-server(x86-64) = 14.1-1Crunchy.el8.centos, but none of the providers can be installed
  - package postgresql14-llvmjit-14.2-0Crunchy.el8.centos.x86_64 requires postgresql14-server(x86-64) = 14.2-0Crunchy.el8.centos, but none of the providers can be installed
  - package postgresql14-server-14.2-0Crunchy.el8.x86_64 requires postgresql14(x86-64) = 14.2-0Crunchy.el8, but none of the providers can be installed
  - package postgresql14-server-14.1-1Crunchy.el8.centos.x86_64 requires postgresql14(x86-64) = 14.1-1Crunchy.el8.centos, but none of the providers can be installed
  - package postgresql14-server-14.2-0Crunchy.el8.centos.x86_64 requires postgresql14(x86-64) = 14.2-0Crunchy.el8.centos, but none of the providers can be installed
  - cannot install both postgresql14-14.0-0Crunchy.el8.centos.x86_64 and postgresql14-14.2-0Crunchy.el8.x86_64
  - cannot install both postgresql14-14.1-1Crunchy.el8.centos.x86_64 and postgresql14-14.0-0Crunchy.el8.centos.x86_64
  - cannot install both postgresql14-14.2-0Crunchy.el8.centos.x86_64 and postgresql14-14.0-0Crunchy.el8.centos.x86_64
  - package postgresql14-devel-14.0-0Crunchy.el8.centos.x86_64 requires postgresql14(x86-64) = 14.0-0Crunchy.el8.centos, but none of the providers can be installed
  - conflicting requests
  - package postgresql14-devel-14.1-0Crunchy.el8.centos.x86_64 requires postgresql14(x86-64) = 14.1-0Crunchy.el8.centos, but none of the providers can be installed
  - cannot install both postgresql14-14.1-0Crunchy.el8.centos.x86_64 and postgresql14-14.2-0Crunchy.el8.x86_64
  - cannot install both postgresql14-14.1-1Crunchy.el8.centos.x86_64 and postgresql14-14.1-0Crunchy.el8.centos.x86_64
  - cannot install both postgresql14-14.2-0Crunchy.el8.centos.x86_64 and postgresql14-14.1-0Crunchy.el8.centos.x86_64
  - nothing provides libLLVM-11.so()(64bit) needed by postgresql14-llvmjit-14.0-0Crunchy.el8.centos.x86_64
  - nothing provides libLLVM-11.so(LLVM_11)(64bit) needed by postgresql14-llvmjit-14.0-0Crunchy.el8.centos.x86_64
  - nothing provides libLLVM-11.so()(64bit) needed by postgresql14-llvmjit-14.1-0Crunchy.el8.centos.x86_64
  - nothing provides libLLVM-11.so(LLVM_11)(64bit) needed by postgresql14-llvmjit-14.1-0Crunchy.el8.centos.x86_64
  - llvm-devel-13.0.1-1.module+el8.6.0+14118+d530a951.i686 has inferior architecture
  - package postgresql14-devel-14.1-1Crunchy.el8.centos.x86_64 requires llvm-devel >= 8.0.1, but none of the providers can be installed
  - package llvm-devel-13.0.1-1.module+el8.6.0+14118+d530a951.x86_64 requires libLLVM-13.so()(64bit), but none of the providers can be installed
  - package llvm-devel-13.0.1-1.module+el8.6.0+14118+d530a951.x86_64 requires libLLVM-13.so(LLVM_13)(64bit), but none of the providers can be installed
  - package llvm-devel-13.0.1-1.module+el8.6.0+14118+d530a951.x86_64 requires llvm-libs(x86-64) = 13.0.1-1.module+el8.6.0+14118+d530a951, but none of the providers can be installed
  - cannot install both llvm-libs-13.0.1-1.module+el8.6.0+14118+d530a951.x86_64 and llvm-libs-12.0.1-2.module+el8.5.0+12488+254d2a07.x86_64
  - package postgresql14-llvmjit-14.1-1Crunchy.el8.centos.x86_64 requires libLLVM-12.so()(64bit), but none of the providers can be installed
  - package postgresql14-llvmjit-14.1-1Crunchy.el8.centos.x86_64 requires libLLVM-12.so(LLVM_12)(64bit), but none of the providers can be installed
  - cannot install both postgresql14-14.1-1Crunchy.el8.centos.x86_64 and postgresql14-14.2-0Crunchy.el8.x86_64
  - cannot install both postgresql14-14.2-0Crunchy.el8.centos.x86_64 and postgresql14-14.1-1Crunchy.el8.centos.x86_64
  - package postgresql14-devel-14.1-1Crunchy.el8.centos.x86_64 requires postgresql14(x86-64) = 14.1-1Crunchy.el8.centos, but none of the providers can be installed
  - package postgresql14-devel-14.2-0Crunchy.el8.centos.x86_64 requires llvm-devel >= 8.0.1, but none of the providers can be installed
  - package postgresql14-llvmjit-14.2-0Crunchy.el8.centos.x86_64 requires libLLVM-12.so()(64bit), but none of the providers can be installed
  - package postgresql14-llvmjit-14.2-0Crunchy.el8.centos.x86_64 requires libLLVM-12.so(LLVM_12)(64bit), but none of the providers can be installed
  - cannot install both postgresql14-14.2-0Crunchy.el8.centos.x86_64 and postgresql14-14.2-0Crunchy.el8.x86_64
  - package postgresql14-devel-14.2-0Crunchy.el8.centos.x86_64 requires postgresql14(x86-64) = 14.2-0Crunchy.el8.centos, but none of the providers can be installed