Skip to content

Commit

Permalink
#16 Oracle Express Edition - Image, Containers
Browse files Browse the repository at this point in the history
  • Loading branch information
aavanesy committed Apr 3, 2024
1 parent 9f490f5 commit 1258f3d
Show file tree
Hide file tree
Showing 4 changed files with 108 additions and 0 deletions.
28 changes: 28 additions & 0 deletions compose_files/docker-compose.db-oracle-xe.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@

version: '3'
volumes:
oracle-db-xe:
driver: local

networks:
oracle-network-xe:
driver: bridge

services:
#Oracle Database Express Edition
oracle-xe:
image: container-registry.oracle.com/database/express:latest
container_name: oracle-xe
ports:
- "1521:1521"
networks:
- oracle-network-xe
healthcheck:
test: ["CMD-SHELL", "cat /sql/init.sql | sqlplus -S SYS/Oradoc_db1 AS SYSDBA"]
start_period: 60s
interval: 10s
timeout: 5s
retries: 10
volumes:
- oracle-db-xe:/opt/oracle/oradata
- ./init.sql:/sql/init.sql
25 changes: 25 additions & 0 deletions compose_files/docker-compose.oracle-xe.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@

version: '3'

include:
- docker-compose.db-oracle-xe.yml

services:

# -- ORACLE SERVICE --

rdb_oracle-xe:
container_name: rdb_oracle-xe
image: ghcr.io/krlmlr/rdb/r-oracle-xe
platform: linux/amd64
tty: true
stdin_open: true
depends_on:
oracle-xe:
condition: service_healthy
networks:
- oracle-network-xe
volumes:
# simple test
- ./test/test-oracle.R:/root/workspace/.Rprofile
entrypoint: ["R"]
1 change: 1 addition & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ include:
- compose_files/docker-compose.postgres.yml
- compose_files/docker-compose.sqlite.yml
- compose_files/docker-compose.adbi.yml
- compose_files/docker-compose.oracle-xe.yml
54 changes: 54 additions & 0 deletions r_images/r_oracle-xe/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
FROM ghcr.io/cynkra/rig-ubuntu-dbi:main

RUN mkdir -p /root/workspace

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 = oracle-xe"; \
echo "ServerName = //oracle-xe:1521/XE"; \
echo "Port = 1521"; \
echo "Database = XE"; \
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

WORKDIR /root/workspace

0 comments on commit 1258f3d

Please sign in to comment.