Introduction
As you may have noticed, Oracle has released a few weeks ago Docker build files for the Oracle Database on Github and an associated blog post. Should you read the blog post, you would notice that you need to download manually the oracle binaries.
The purpose of this post is to provide a modified version of the original build files (focusing on the 12.1.0.2 database EE only), so that the oracle binaries are downloaded during the build of the image (thanks to Maris Elsins’s getMOSPatch script).
Create the 12.1.0.2 database docker image
The manual steps are:
Install the docker engine (You can find detailed instructions here), basically you have to add the yum repository and launch:
root@docker# yum install docker-engine
Change the maximum container size to 20 GB:
root@docker# docker daemon --storage-opt dm.basesize=20G
Clone those files from github:
root@docker# git clone https://github.com/bdrouvot/oracledb-docker.git
Update the oracledb-docker/Dockerfile file (ENV section only) with the appropriate values:
- ORACLE_PWD=”<put_the_password_you_want>”
- MOSU=”<your_oracle_support_username>”
- MOSP=”<your_oracle_support_password>”
Build the Image:
root@docker# docker build --force-rm=true --no-cache=true -t oracle/database:12.1.0.2 .
That’s it, now we can:
Use the Image
Simply start a docker container that way:
root@docker# docker run -p 1521:1521 --name bdt12c oracle/database:12.1.0.2
The host that is running the docker engine is “docker”. You can connect to the database as you would do normally, for example, using Oracle SQL Developper:
Note that the Hostname is “docker”, that is to say the one that is hosting the docker engine.
Remarks
- At the time of this writing Oracle Database on Docker is NOT supported by Oracle. Use these files at your own discretion.
- If you are interested in this kind of stuff, then you should also read Frits Hoogland’s blog post.
- The Dockerfile used is very closed to the one provided by Oracle (Gerald Venzl). Only a few things have been modified to download the oracle binaries during the image creation.
- Thanks to Maris Elsins for getMOSPatch.