rstudio / rstudio-docker-products

Docker images for RStudio Professional Products

Home Page:https://hub.docker.com/u/rstudio

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add Oracle client to r-session-complete image

smokedlinq opened this issue · comments

Opened this ticket over on the helm repo, which resulted in a support case 83399 that said the Oracle client is required for connectivity to work. Is this something that can be added?

Howdy @smokedlinq ! Thanks for reporting here 😄

Unfortunately, I think Oracle's license for the client is somewhat restrictive, which prevents us from embedding into our public image 😬 I would think that the easiest way to do this might be to

(1) put the Oracle client on a shared volume of some stripe and mount it into the container
(2) put a copy of the Oracle client somewhere that you can retrieve easily from the command line (i.e. over HTTP via curl, using a blob store like AWS S3, etc.)
- you can then test this interactively for an existing session
- once satisfied, we could look at other ways to bring the file in... customizing startup is a bit tricky, but it should be do-able.
- another option would be to see if putting the client into users' home directories or some other /home/oracle path or something

Do either of these seem palatable to you? Do you have any other ideas that come to mind?

Something that may help tangentally; we build our own images from base, we adapted the guidance at https://support.posit.co/hc/en-us/articles/360035214073, and execute this .sh file in our Dockerfile

# install-db-roracle.sh
#!/bin/bash

# RPM Approach

# INSTRUCTIONS:
# 1) Put into main Dockerfile
# COPY install-db-roracle.sh /
# ENV OCI_LIB=/opt/oracle/instantclient_21_4
# ENV LD_LIBRARY_PATH=/opt/oracle/instantclient_21_4:$LD_LIBRARY_PATH
# RUN dos2unix ./install-db-roracle.sh
# RUN chmod u+x ./install-db-roracle.sh
# RUN ./install-db-roracle.sh
# 2) Ensure the ENV is declared at the Dockerfile level as export declared within a script only live within that script

mkdir /opt/oracle
cd /opt/oracle 

apt-get update && apt-get install -y --no-install-recommends \
    unzip \
    libaio1 \
    unixodbc \
    unixodbc-dev \
    gdebi \
    alien
    
# https://www.oracle.com/database/technologies/instant-client/linux-x86-64-downloads.html

curl https://download.oracle.com/otn_software/linux/instantclient/1915000/oracle-instantclient19.15-basic-19.15.0.0.0-1.x86_64.rpm -o /tmp/oracle-instant-client-basic.rpm
curl https://download.oracle.com/otn_software/linux/instantclient/1915000/oracle-instantclient19.15-devel-19.15.0.0.0-1.x86_64.rpm -o /tmp/oracle-instant-client-sdk.rpm
curl https://download.oracle.com/otn_software/linux/instantclient/1915000/oracle-instantclient19.15-sqlplus-19.15.0.0.0-1.x86_64.rpm -o /tmp/oracle-instant-sqlplus.rpm

alien -i /tmp/oracle-instant-client-basic.rpm
alien -i /tmp/oracle-instant-client-sdk.rpm
alien -i /tmp/oracle-instant-sqlplus.rpm

echo "---- Check unzipped files"
find /usr/lib/oracle/19.15/
namei -l /usr/lib/oracle/19.15/
echo "---- Create symbolic link"
cd /usr/lib/oracle/19.15/client64/lib
# ln -s libclntsh.so.11.1   libclntsh.so # ROracle Instructions
ln -s /usr/lib/oracle/19.15/client64/lib* /opt/rstudio-drivers/oracle/bin/lib/ # https://docs.rstudio.com/pro-drivers/installation/ # https://support.rstudio.com/hc/en-us/articles/360035214073

This might get you enough to customize your own image with Oracle client.

@colearendt I believe the latest clients use the FUTC for the client: https://www.oracle.com/database/technologies/appdev/jdbc-downloads.html

Interesting! Yeah, we'll need to take a deeper look at the license - good to see they have opened it up a bit 😄 There also may be a file size issue / concern, but not sure what that looks like.