Using post-install script of Docker Oracle XE images to upgrade to Apex 5.1.2

You can use Oracle Official 11gXE image on Docker with latest Apex available for downloading at Oracle OTN Web Site, now 5.1.2 release, by simple adding three shell scripts.

First you have to build your Oracle 11g base image by running the script downloaded from GitHub and providing the binary installation at OracleDatabase/dockerfiles/ directory, here a sample directory content structure:

OracleDatabase/dockerfiles/ directory contents

next at the parent directory run this command:

./ -v -x

as a result of the docker build command you will get a fresh local image of 11gXE ready to use:

# docker image ls
oracle/database b35223c35d5c 3 minutes ago 1.13GB

latest Oracle scripts include a hook to provide extra functionality as post installation task, here an example of custom scripts, so if we start a container as:

docker run — shm-size=1g — name apex — hostname apex \
-p 1521:1521 -p 8080:8080 \
-v $PWD/apex-as-postscripts:/u01/app/oracle/scripts/setup \

Note that unlike the file the mount point inside XE build image script is /u01/app/oracle/scripts/setup, not /opt/oracle/scripts/setup.

The content of directory apex-as-postscripts is:

content of directory apex-as-postscripts

You can download these scripts at my GitHub repo, but before starting your docker container put inside the directory the Apex distribution file For newer releases simple put a new zip and edit script with a proper file name.

Concluding with first time execution of the container output console will look like

now Apex is ready to use, try http://localhost:8080/apex/apex_admin and you will get login screen (use admin and sys/system password generated by Docker install script)

first login Apex admin screen

next screen will ask you for changing admin password

password change for admin user

And that's all you have an instance of latest Oracle Apex running as Docker container.

Remember that we started this image with ephemeral storage for the RDBMS, your Oracle instance will preserve any database change between stop/start cycle, but if you remove the image all changes will be discharged. To avoid that, simple map the RDBMS data-files to an external directory or docker volume, for example:

docker run — shm-size=1g — name apex — hostname apex \
-p 1521:1521 -p 8080:8080 \
-v /home/data/db/apex:/u01/app/oracle/oradata \
-v $PWD/apex-as-postscripts:/u01/app/oracle/scripts/setup \

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store