diff --git a/Dockerfile b/Dockerfile index 6c4dcc9ef..fa41a65ad 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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 + + + + diff --git a/Makefile b/Makefile index 5c3e04765..6222e0fb7 100644 --- a/Makefile +++ b/Makefile @@ -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")'