Building Oracle 18.0.0.0 Docker image

First, this post is for building Oracle 18.0.0.0 RDBMS image for testing purpose due is not officially supported by Oracle yet.

There are two great post for doing similar task by Rodrigo Jorge and Mahmoud Hatem giving me the starting point for making these scripts, but none of above solutions works with Docker.

The point is that for the initial Rodrigo's idea as Hatem set many people doesn't have access to an Oracle Cloud account for downloading a patched library and in case of the solution by Hatem it doesn't work on Docker environment because is not possible to install kernel modules at the kernel running your binary.

My solution is using a linker trick to replace a library call, usually is used for System's call replacement (LD_PRELOAD variable), but in this case is to replace a library function call. The replacement is for the function ksz_exadata_feature_on which resides at the library libserver18.a the linker flag is placed at ldflags file (added -wrap=ksz_exadata_feature_on -lexadata_wrap) which means that any call to a function ksz_exadata_feature_on will be replaced by __wrap_ksz_exadata_feature_on which resides at the lib libexadata_wrap.so, compiled from exadata_wrap.c sources.

OK, lets build the Oracle RDBMS 18.0.0.0 Docker image, first clone or download my branch of Oracle Repository, change to the directory docker-images/OracleDatabase/dockerfiles and run this command:

Image for post
Image for post
Build command for 18.0.0.0 RDBMS Docker image

Remember that above command assume that you already downloaded your V974953–01.zip and it resides at 18.0.0.0 directory.

buildDockerImage.sh script will take a long time to build the new image, once it ready your image will look like:

Image for post
Image for post
docker build command's output
Image for post
Image for post
list of Oracle RDBMS local images

Once you have the image ready you can start your 18c Database running:

Image for post
Image for post
docker run sample for using 18c Docker image

flags explanation are:

docker run -d --name <container name> \
-p <host port>:1521 -p <host port>:5500 \
-e ORACLE_SID=<your SID> \
-e ORACLE_PDB=<your PDB name> \
-e ORACLE_PWD=<your database passwords> \
-e ORACLE_CHARACTERSET=<your character set> \
-v [<host mount point>:]/scratch/app/user/oradata \
oracle/database:18.0.0.0-ee

Parameters:
--name: The name of the container (default: auto generated)
-p: The port mapping of the host port to the container port.
Two ports are exposed: 1521 (Oracle Listener), 5500 (OEM Express)
-e ORACLE_SID: The Oracle Database SID that should be used (default: ORCLCDB)
-e ORACLE_PDB: The Oracle Database PDB name that should be used (default: ORCLPDB1)
-e ORACLE_PWD: The Oracle Database SYS, SYSTEM and PDB_ADMIN password (default: auto generated)
-e ORACLE_CHARACTERSET:
The character set to use when creating the database (default: AL32UTF8)
-v /scratch/app/user/oradata
The data volume to use for the database.
Has to be writable by the Unix "oracle" (uid: 54321) user inside the container!
If omitted the database will not be persisted over container recreation.
-v /scratch/app/user/scripts/startup | /docker-entrypoint-initdb.d/startup
Optional: A volume with custom scripts to be run after database startup.
For further details see the "Running scripts after setup and on startup" section below.
-v /scratch/app/user/scripts/setup | /docker-entrypoint-initdb.d/setup
Optional: A volume with custom scripts to be run after database setup.
For further details see the "Running scripts after setup and on startup" section below.

First execution of above Docker run command will create a RDBMS instance located at /home/data/db/test18c local directory, and log output end with:

Image for post
Image for post
log output showing successful Database creation

I didn't make a test on Windows or Mac, but by definition above image will run without any problem on any Docker's supported platform. Have fun using latest 18c Oracle Release, public version for on-premise installation is planning for July 2018.

Bonus EM's sample capture sample:

Image for post
Image for post
Oracle EM 18.1.0.0.0 running in my notebook

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