Skip to content

Instantly share code, notes, and snippets.

@dr-kd
Created October 4, 2022 23:21
Show Gist options
  • Save dr-kd/e9659b25795e9d2a4a6836f446c9457e to your computer and use it in GitHub Desktop.
Save dr-kd/e9659b25795e9d2a4a6836f446c9457e to your computer and use it in GitHub Desktop.
postgres oracle fdw container
ARG postgres_version=15beta4
FROM postgres:$postgres_version
ARG oracle_fdw_version=2_4_0
ENV ORACLE_HOME /usr/lib/oracle/19.6/client64
ENV LD_LIBRARY_PATH /usr/lib/oracle/19.6/client64/lib
RUN set -ex; \
apt-get update && apt-get install -y --no-install-recommends \
apt-utils \
libaio1 \
libaio-dev \
build-essential \
git-core \
curl \
less \
make \
unzip \
htop \
emacs-nox \
postgresql-server-dev-15 \
postgresql-common \
alien \
libicu-dev \
ca-certificates; \
mkdir /var/build; \
cd /var/build; \
curl https://yum.oracle.com/repo/OracleLinux/OL7/oracle/instantclient/x86_64/getPackage/oracle-instantclient19.6-basic-19.6.0.0.0-1.x86_64.rpm -O;\
alien --scripts oracle-instantclient19.6-basic-19.6.0.0.0-1.x86_64.rpm; \
curl -O https://yum.oracle.com/repo/OracleLinux/OL7/oracle/instantclient/x86_64/getPackage/oracle-instantclient19.6-devel-19.6.0.0.0-1.x86_64.rpm; \
alien oracle-instantclient19.6-devel-19.6.0.0.0-1.x86_64.rpm; \
dpkg -i *oracle*.deb; \
echo export ORACLE_HOME=/usr/lib/oracle/19.6/client64/ | cat >> /etc/profile; \
echo ' [[ YOUR TNSNAMES ENTRY HERE ]] ' > $ORACLE_HOME/lib/network/admin/tnsnames.ora ; \
git clone https://github.com/orafce/orafce.git; \
cd orafce; \
make && make install; \
cd /var/build; \
git clone https://github.com/laurenz/oracle_fdw.git; \
cd oracle_fdw; \
make && make install;\
cd /var/build; \
git clone https://github.com/citusdata/pg_cron.git; \
cd pg_cron; \
make && make install; \
cd; \
rm -rf /var/build; \
apt-get clean; \
apt-get autoremove;
ENTRYPOINT ["docker-entrypoint.sh"]
EXPOSE 5432
CMD ["postgres"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment