Skip to content

Commit

Permalink
#2813 dm Dockerfile adjustment to include oracle drivers and settings
Browse files Browse the repository at this point in the history
  • Loading branch information
aavanesy committed Jan 19, 2024
1 parent fe94cbf commit 09b7379
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 1 deletion.
53 changes: 53 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,56 @@ RUN curl https://packages.microsoft.com/config/ubuntu/$(lsb_release -rs)/prod.li
RUN apt-get update

RUN ACCEPT_EULA=Y apt-get install -y msodbcsql18

WORKDIR /opt/oracle/

RUN apt-get update && \
apt-get install -y libaio1 wget unzip

# Download the Oracle Instant Client and ODBC Drivers
RUN wget https://download.oracle.com/otn_software/linux/instantclient/1921000/instantclient-basic-linux.x64-19.21.0.0.0dbru.zip
RUN wget https://download.oracle.com/otn_software/linux/instantclient/1921000/instantclient-odbc-linux.x64-19.21.0.0.0dbru.zip

RUN unzip instantclient-basic-linux.x64-19.21.0.0.0dbru.zip
RUN unzip instantclient-odbc-linux.x64-19.21.0.0.0dbru.zip
RUN rm instantclient-basic-linux.x64-19.21.0.0.0dbru.zip
RUN rm instantclient-odbc-linux.x64-19.21.0.0.0dbru.zip

RUN sh -c "echo /opt/oracle/instantclient_19_21 > \
/etc/ld.so.conf.d/oracle-instantclient.conf"
RUN ldconfig

RUN export LD_LIBRARY_PATH=/opt/oracle/instantclient_19_21:$LD_LIBRARY_PATH
RUN export PATH=/opt/oracle/instantclient_19_21:$PATH

# Path to the odbc.ini file
ARG ODBC_FILE="/etc/odbc.ini"

# Create the odbc.ini file if it doesn't exist, and append the required content
RUN mkdir -p $(dirname $ODBC_FILE) && \
{ \
echo "[oracle]"; \
echo "Driver = OracleODBC-19c"; \
echo "Server = 127.0.0.1"; \
echo "ServerName = //127.0.0.1:1521/FREE"; \
echo "Port = 1521"; \
echo "Database = FREE"; \
echo ""; \
} >> $ODBC_FILE

# Path to the odbc.ini file
ARG ODBCI_FILE="/etc/odbcinst.ini"

# Create the odbc.ini file if it doesn't exist, and append the required content
RUN mkdir -p $(dirname $ODBCI_FILE) && \
{ \
echo "[OracleODBC-19c]"; \
echo "Description = Oracle ODBC driver for Oracle 19c"; \
echo "Driver = /opt/oracle/instantclient_19_21/libsqora.so.19.1"; \
echo "FileUsage = 1"; \
echo ""; \
} >> $ODBCI_FILE




2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ connect-%:

db-start:
docker-compose up -d --force-recreate
./.github/oracle_helpers/file.sh
./.github/oracle_helpers/create_oracle_users.sh
R -q -e 'suppressMessages(pkgload::load_all()); DBI::dbExecute(test_src_maria(root = TRUE)$$con, "GRANT ALL ON *.* TO '"'"'compose'"'"'@'"'"'%'"'"';"); DBI::dbExecute(test_src_maria()$$con, "FLUSH PRIVILEGES")'
R -q -e 'suppressMessages(pkgload::load_all()); DBI::dbExecute(test_src_mssql(FALSE)$$con, "CREATE DATABASE test")'

Expand Down

0 comments on commit 09b7379

Please sign in to comment.