Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not exactly an issue but I used your work to provide an alternative way of building the container. #1

Open
dr-kd opened this issue Oct 6, 2022 · 1 comment

Comments

@dr-kd
Copy link

dr-kd commented Oct 6, 2022

Thanks for doing this - made some things nice and easy for me. It turns out that orafdw is a better oracle client than sqlplus :).

I did this because I needed some other extensions. It stops having to haul around the instant client binaries in the repo / as a COPY container layer. It's based on your work and can confirm it works. (I also needed pg 15)

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 \
        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"]
@mfvitale
Copy link
Owner

mfvitale commented Oct 6, 2022

Hi @singingfish
good to know this helped you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants