oracle / docker-images

Official source of container configurations, images, and examples for Oracle products and projects
https://developer.oracle.com/use-cases/#containers
Universal Permissive License v1.0
6.59k stars 5.44k forks source link

Issue with shared libraries on build #548

Closed hmspider closed 7 years ago

hmspider commented 7 years ago

Hi, Using buildDockerImage.sh script, Alpine Linux 3.6.2. Output is:

Starting Oracle Net Listener...Done Configuring database...grep: /u01/app/oracle/product/11.2.0/xe/config/log/.log: No such file or directory grep: /u01/app/oracle/product/11.2.0/xe/config/log/.log: No such file or directory Done /bin/chmod: cannot access '/u01/app/oracle/diag': No such file or directory Starting Oracle Database 11g Express Edition instance...Done Installation completed successfully. sqlplus: error while loading shared libraries: libnnz11.so: cannot enable executable stack as shared object requires: Permission denied mv: cannot stat '/u01/app/oracle/product/11.2.0/xe/dbs/spfileXE.ora': No such file or directory mv: cannot stat '/u01/app/oracle/product/11.2.0/xe/dbs/orapwXE': No such file or directory ######################### DATABASE IS READY TO USE! ######################### The following output is now a tail of the alert.log: tail: cannot open '/u01/app/oracle/diag/rdbms/*/*/trace/alert*.log' for reading: No such file or directory

Starting container with command docker run --shm-size=1g -p 1521:1521 -p 8080:8080 -v /u01/app/oracle/oradata oracle/database:11.2.0.2-xe results in failure (the container just exits).

Any hints appreciated.

gvenzl commented 7 years ago

It looks like that something went wrong during the startup of the container. I notice some strange characters in the output, for example the three forward slashes /// between .../rdbms/ and .../trace/: tail: cannot open '/u01/app/oracle/diag/rdbms///trace/alert*.log' for reading: No such file or directory

The source of the shell script though is: tail -f $ORACLE_BASE/diag/rdbms/*/*/trace/alert*.log & with two clear *

Can you go inside a new container and check whether the runOracle.sh file is intact?

hmspider commented 7 years ago

runOracle.sh looks intact: tail -f $ORACLE_BASE/diag/rdbms/*/*/trace/alert*.log Running the command in a shell as root:

bash-4.2# tail -f $ORACLE_BASE/diag/rdbms/*/*/trace/alert.log tail: cannot open '/u01/app/oracle/diag/rdbms/*/*/trace/alert.log' for reading: No such file or directory

The *'s were not showing in original post because I didn't escape them in markdown quote, I just updated it (sorry for that).

gvenzl commented 7 years ago

Ah ok, then this was a red herring. Are you sure that the build didn't throw any error?

Configuring database...grep: /u01/app/oracle/product/11.2.0/xe/config/log/.log: No such file or directory

This should just go through and and throw now error. I wonder whether something is going wrong during the config or whether the install earlier was already faulty. Do you have the path /u01/app/oracle/product/11.2.0/xe available within your image? Can you please go ahead and check? Also, are there any files in there. An ls -al would come handy.

If you still have the build output, can you also people include that.

hmspider commented 7 years ago

Hi Gerald, After having tweaked the Dockerfile in order to overcome shared library access being denied to sqlplus, the build & first config went smoothly, with the following exception:

mv: cannot stat '/u01/app/oracle/product/11.2.0/xe/dbs/orapwXE': No such file or directory ######################### DATABASE IS READY TO USE! ######################### The following output is now a tail of the alert.log: Current log# 5 seq# 4 mem# 0: /u01/app/oracle/oradata/XE/redo05.log ALTER DATABASE DROP LOGFILE GROUP 1

Changes to Dockerfile.xe:

I guess SELinux was making my life difficult.

Pasting the output of ls -al /u01/app/oracle/product/11.2.0/xe as per asked:

total 100 drwxr-xr-x 1 oracle dba 4096 Aug 20 16:28 . drwxr-xr-x 1 oracle dba 4096 Aug 20 16:28 .. drwxr-xr-x 2 oracle dba 4096 Aug 20 16:28 apex drwxr-xr-x 2 oracle dba 4096 Aug 20 16:28 bin drwxr-xr-x 1 oracle dba 4096 Aug 20 16:33 config drwxr-xr-x 9 oracle dba 4096 Aug 20 16:28 ctx drwxr-xr-x 1 oracle dba 4096 Aug 23 16:12 dbs drwxr-xr-x 3 oracle dba 4096 Aug 20 16:28 demo drwxr-xr-x 4 oracle dba 4096 Aug 20 16:28 hs drwxr-xr-x 3 oracle dba 4096 Aug 20 16:28 jdbc drwxr-xr-x 2 oracle dba 4096 Aug 20 16:28 jlib drwxr-xr-x 3 oracle dba 4096 Aug 20 16:28 ldap drwxr-xr-x 2 oracle dba 4096 Aug 20 16:28 lib drwxr-xr-x 3 oracle dba 4096 Aug 20 16:28 md drwxr-xr-x 1 oracle dba 4096 Aug 20 16:28 network drwxr-xr-x 5 oracle dba 4096 Aug 20 16:28 nls drwxr-xr-x 7 oracle dba 4096 Aug 20 16:28 odbc drwxr-xr-x 4 oracle dba 4096 Aug 20 16:28 opmn drwxr-xr-x 4 oracle dba 4096 Aug 20 16:28 oracore drwxr-xr-x 4 oracle dba 4096 Aug 20 16:28 plsql drwxr-xr-x 4 oracle dba 4096 Aug 20 16:28 precomp drwxr-xr-x 12 oracle dba 4096 Aug 20 16:28 rdbms drwxr-xr-x 3 oracle dba 4096 Aug 20 16:28 slax drwxr-xr-x 4 oracle dba 4096 Aug 20 16:28 sqlplus drwxr-xr-x 6 oracle dba 4096 Aug 20 16:28 xdk

gvenzl commented 7 years ago

Hi @hmspider,

Yes, SELinux does not allow all the operations performed by Docker so there can certainly be a problem with running SELinux in enforcing mode.

Hm, on the first creation the startup script will move the password file and others from the $ORACLE_HOME location into the volume (dbconfig/$ORACLE_SID). It seems that you didn't have a password file to begin with but the $ORACLE_HOME is here at least.

Did the database come up alright? Did you specify a volume? If so, can you see whether you find that file in /dbconfig/XE/orapwXE

gvenzl commented 7 years ago

Closing due to lack of response.