Closed CollinEstes closed 9 years ago
Does $OCI_HOME/sdk/include contain occi.h?
So I thought it did but looks like it doesn't find it, most likely the OCI_HOME isn't getting set correctly I guess.
I add this to my shell file to test for it
[ -f $OCI_HOME/sdk/include/occi.h ] && echo "Found" || echo "Not found"
But I got a Not found. I must not be setting up the env. variables right, but I'm not sure what is going wrong.
Once you resolve the env var issue, make sure you are running the 'ln -s' commands in the right directory. DYLD_LIBRARY_PATH is an OS X variable, so you can remove that line - and since you run ldconfig you don't need to set LD_LIBRARY_PATH.
Thanks everyone I got it working. For others who may want to do the same here is my dockerfile and corresponding shell script which sets the env variables to use strong-oracle. The issue I was having was that I was not copying my instant clients libraries correctly (had an extra folder level in there) so I was pointing my ENV variables to the wrong place.
This configuration assumes you have put the Oracle instant client Basic libraries at the root of your project in a folder named 'instantclient'. In that folder it assumes you have included the sdk '/sdk/include' folder as well. It also requires the shell script be in the application folder as well named 'oracle_env_vars.sh'. So the structure is:
- app - package.json - ...(node app) - oracle_env_vars.sh - instantclient/ - ... (instantclient binaries) - sdk - include - ...(sdk c code)
DOCKERFILE
# INSTALL UBUNTU
FROM ubuntu:14.04
#UPDATE APT-GET AND INSTALL CURL
RUN apt-get update && apt-get install -y curl
#INSTALL IO.JS
RUN curl -fsSL bit.ly/iojs-dev -o /tmp/iojs-dev.sh; bash /tmp/iojs-dev.sh
#INSTALL libaio1 (NEEDED FOR STRONG-ORACLE)
RUN apt-get install libaio1
#INSTALL ORACLE INSTANT CLIENT
RUN mkdir -p opt/instantclient
ADD ./instantclient /opt/instantclient
#CREATE APP FOLDER AND COPY IN APP
RUN mkdir -p /app
ADD ./ /app
#SETUP ORACLE ENV VARIABLES AND START APP IN SHELL SCRIPT
ADD ./oracle_env_vars.sh run.sh
RUN chmod +x run.sh
CMD ./run.sh
Then the oracle_env_vars.sh
#SETUP STRONG-ORACLE ENVIRONMENT VARIABLES
export OCI_HOME=/opt/instantclient
export OCI_LIB_DIR=$OCI_HOME
export OCI_INCLUDE_DIR=$OCI_HOME/sdk/include
export OCI_VERSION=12
#SETUP STRONG-ORACLE SYMLINKS
cd $OCI_LIB_DIR
ln -s $OCI_LIB_DIR/libclntsh.so.12.1 libclntsh.so
ln -s $OCI_LIB_DIR/libocci.so.12.1 libocci.so
# ADD SHARED OBJECT FILES TO LD CACHE FOR STRONG-ORACLE
echo '/opt/instantclient/' | tee -a /etc/ld.so.conf.d/oracle_instant_client.conf
ldconfig
# PERFORM APP's NPM INSTALL
cd ../../app && npm install
# START APP (ENTER START CMDs - ex "node app")
Pretty new to docker and opts in general so I'm sure there is some improvements in these as well, but it is working. I'm not starting the app in this example so if you intend on using this you will have to add that step to the shell script.
So I'm trying to create a dockerfile for my strong-oracle app to run within,all the instant client libraries are added and the environment variables are set correctly (from what I can tell).
Looking for some help getting over this last hump with it, here is my DockerFile:
and my oracle_env_vars
So it gets through everything all the way to the npm install without failing and I've done some checks echoing my environment variables to prove they are created and everything looks good.
Strong-oracle fails with: