As I spent few days to sort out oracle connection with exsting nodered container,
I'd like to share how I solved the problem as following.
-
download oracle client zip file: ( in my case target oracle version is 11g )
-
Copy inside docker container
docker cp zipFile norered:/data
-
Access docker as root
sudo docker exec -it --user root nodered /bin/bash
-
After creating /data/oracle, copy the zip file and unzip it.
/data/oracle/instantclient_11_2 is created
-
Create soft link
ln -s libclntsh.so.11.1 libclntsh.so
ln -s libocci.so.11.1 libocci.so
-
Install lib ( libaio, libnsl )
apk update
apk add libaio
apk add libnsl -
Set docker environment variable LD_LIBRARY_PATH from host
sudo su
systemctl stop docker- The following path is different based on your container
vi /var/lib/docker/containers/ed76126653847ec5658983e2dd2da94fe96268b087887d52a6ec12e473ea301a/config.v2.json
Add the following to Env
"Env":["LD_LIBRARY_PATH=/data/oracle/instantclient_11_2:/usr/lib",
systemctl start docker
docker start nodered
- The following path is different based on your container
-
Execute oracle DB query using oracle node