Official ORDS container for your 23cFree Docker

Official ORDS container for your 23cFree Docker

Whilst my every popular Oracle 23c Free Docker, APEX & ORDS all in one simple guide blog gets you up and running with a Dockerized APEX environment super quickly, you may which to use a separate container just for ORDS.

In this blog, we'll use the official ORDS docker image and hook it up to our 23cFree DB image we built in the blog above.

Firstly we need to make some amends to our 23cFree Image, basically to disable ORDS.

  1. Make sure it's running and now we enter bash
    docker exec -it 23cfree /bin/bash
    
  2. Stop ORDS from being autostarted
    nano /home/oracle/scripts/start_ords.sh
    
  3. Comment all 4 lines with a # and save the file
    #export ORDS_HOME=/usr/local/bin/ords
    #export _JAVA_OPTIONS="-Xms512M -Xmx512M"
    #LOGFILE=/home/oracle/logs/ords-`date +"%Y""%m""%d"`.log
    #nohup ${ORDS_HOME} --config /etc/ords/config serve >> $LOGFILE 2>&1 & echo "View log file with : tail -f $LOGFILE"
    
  4. now exit out of Bash
    exit
    
  5. now create a docker network and add the 23cFree container to it
    docker network create ords_and_apex
    docker network connect ords_and_apex 23cfree
    docker restart 23cfree
    
  6. We've finished with the customizations, Now we need to set up the ORDS container.
    mkdir C:\oracle\ORDS\ords23cFree
    echo CONN_STRING=sys/E@23cfree:1521/FREEPDB1 > C:\oracle\ORDS\ords23cFree\conn_string.txt
    echo export _JAVA_OPTIONS="-Xms512M -Xmx512M" > C:\oracle\ORDS\ords23cFree\01_set_java_size.sh
    
  7. Windows users only: open the two files in C:\oracle\ORDS\ords23cFree and change the line feeds from CRLF to LF. You can do this in VSCode and re-save both files. Look for the tiny arrow at the bottom of this picture

  8. Click on the Oracle Container Registry > Database > ords.
    It will give you the Version Matrix i.e 23.1.4 - ORDS 23.1.4 and APEX 22.2.0

  9. If your APEX is lower in your 23cFree container than this version then...

    a. If you want to update APEX to the version above then run this.

     docker run -d -it --name ords23cFree -e --network=ords_and_apex -v C:\oracle\ORDS\ords23cFree:/ords-entrypoint.d/ -v C:\oracle\ORDS\ords23cFree:/opt/oracle/variables -p 8181:8181 container-registry.oracle.com/database/ords:latest
    

    b. If you want to keep APEX to the version you already have then run this. You'll then need to run a version of step 11 with the correct images for that version.

     docker run -d -it --name ords23cFree -e IGNORE_APEX=TRUE --network=ords_and_apex -v C:\oracle\ORDS\ords23cFree:/ords-entrypoint.d/ -v C:\oracle\ORDS\ords23cFree:/opt/oracle/variables -p 8181:8181 container-registry.oracle.com/database/ords:latest
    

    Now you are good to go and do not need to follow any more steps.

    Just log in at localhost:8181/ords and ENJOY APEX

  10. If your 23cFree APEX is higher (or the same version) in your container than the version above then run this

    docker run -d -it --name ords23cFree -e IGNORE_APEX=TRUE --network=ords_and_apex -v C:\oracle\ORDS\ords23cFree:/ords-entrypoint.d/ -v C:\oracle\ORDS\ords23cFree:/opt/oracle/variables -p 8181:8181 container-registry.oracle.com/database/ords:latest
    
  11. Now update the images:

    Connect via Bash

     docker exec -it ords23cFree /bin/bash
    

    Before running the following... find the 22.2.0 in the code below and replace it with the version from step 8.

    Note: Im downloading .../otn_software/apex/apex-latest.zip you need to find the correct URL for your version of APEX

    docker exec -it 23cfree /bin/bash
    cd /home/oracle
    curl -o apex-latest.zip https://download.oracle.com/otn_software/apex/apex-latest.zip
    curl -o unzip.rpm https://yum.oracle.com/repo/OracleLinux/OL8/baseos/latest/x86_64/getPackage/unzip-6.0-46.el8.x86_64.rpm
    rpm -i unzip.rpm
    unzip apex-latest.zip
    rm apex-latest.zip
    cd apex
    mv /opt/oracle/apex/images/22.2.0 /opt/oracle/apex/images/x22.2.0
    mkdir /opt/oracle/apex/images/22.2.0
    cp -R /home/oracle/apex/images/* /opt/oracle/apex/images/22.2.0
    exit
    
  12. Now you are good to go!

    Just log in at localhost:8181/ords

  13. ENJOY APEX