Hi
I’m running an oracle database in an docker container.
The database get’s up fine and is running.
Whoever after some time, the container is marked as “(unhealthy)”.
After starting the database, I run an tail -f on the alertlog.
Otherwise the container would shut down, wouldn’t it?
The Dockerfile ends like this:
USER oracle
EXPOSE 1521 5500
HEALTHCHECK --interval=5m --start-period=10m
CMD /home/oracle/scripts/healthcheck.sh >/dev/null || exit 1
CMD exec /home/oracle/scripts/startup.sh
The “startup Script”
export ORACLE_SID=mydb
export ORACLE_BASE=/opt/oracle
export ORACLE_HOME=/opt/oracle/product/18c/dbhomeXE/
export PATH=$PATH:$HOME/.local/bin:$HOME/bin:$ORACLE_HOME/bin
echo “******************************************************************************”
echo “Handle shutdowns.” date
echo “docker stop --time=30 {container}” date
echo “******************************************************************************”
function gracefulshutdown {
dbshut $ORACLE_HOME
}
trap gracefulshutdown SIGINT
trap gracefulshutdown SIGTERM
trap gracefulshutdown SIGKILL
dbstart $ORACLE_HOME
ORACLE_SID=mydb
ORAENV_ASK=NO
. oraenv
cd
cd scripts
sqlplus / as sysdba @start_services.sql
tail -f {ORACLE_BASE}/diag/rdbms/{ORACLE_SID}/{ORACLE_SID}/trace/alert_{ORACLE_SID}.log &
bgPID=$!
wait $bgPID
Thx
Christian