Spread the love


At Dockercon last month, Oracle released  its flagship databases, middleware and developer tools into the Docker Store marketplace via the Docker Certification Program. What does it mean to developers like me? It means that now you can pull OFFICIAL images of Oracle products in Docker and quickly start developing, testing and deploying modern enterprise applications. Isn’t it cool?

The Docker Certification Program (DCP)  framework is gaining  a lot of attention among partners which is a single platform allowing them to integrate and certify their technology to the Docker EE commercial platform. As of today, Oracle published Oracle Instant Client, Oracle Java 8 SE (Server JRE), Oracle Coherence, Oracle Database Enterprise Edition & Oracle Linux. You can directly view the solutions offered under this link.



Under this post, I will demonstrate how to get started with Oracle Database Enterprise Edition in very simplified way:

Step-1:  Logging / Registering to Docker Store

You will need Dockerhub Account to login to Docker Store and pull Oracle Database EE Docker Image as shown below:

sudo  docker login
Login with your Docker ID to push and pull images from Docker Hub. If you don’t have a Docker ID, head over to https://hub.docker.com to create one.
Username (ajeetraina): ajeetraina
Login Succeeded
[root@pxemaster ~]#


Step-2: Pulling Oracle Database Enterprise Docker Image

sudo docker pull store/oracle/database-enterprise:

Let us verify once the image has been pulled:


Its 5.27 GB in size and hence might take long time based on your network connectivity.  I have pulled other Oracle products too as shown above.

Step-3:  Preparing Environment File

To create a database container, we need to use the environment file below to pass configuration parameters into container:

## Specify the basic DB parameters

## db sid (name)
## default : ORCL
## cannot be longer than 8 characters


## db passwd
## default : Oracle


## db domain
## default : localdomain


## db bundle
## default : basic
## valid : basic / high / extreme
## (high and extreme are only available for enterprise edition)


## end

The above is just an example file. You can make changes accordingly. I have changed DB_DOMAIN, DB_SID and DB_PASSWD according to my infrastructure. Save the file by name “env”.


Step-4: Running the Oracle Database Enterprise Container

sudo docker run -d --env-file env -p 1527:1521 -p 5507:5500 -it --name oracleDB --shm-size="12g" store/oracle/database-enterprise:


env is the path to the environment file you created using above example.
1521 is the port on host machine to map the container’s 1521 port (listener port).
5500 is the port on host machine to map the container’s 5500 port (http service port).
oracledb is the container name you want to create.
12g is the memory size for the container to run. The minimum requirement is 4GB (–shm-size=”4g”).
store/oracle/database-enterprise: is the image that you use to create a container.

Step-5:  Verify that the oracleDB container is running or not:

sudo docker ps


As shown above, the container ID starting with d88 indicates Oracle Database container running.

“…We are not yet done. ..”

You can enter into the container and verify that Oracle Linux Server is the base image for this container.



Step-6:  Running the required script to start Oracle Database

The database setup and startup are executed by running “/bin/bash /home/oracle/setup/dockerInit.sh“, which is the default CMD instruction in the images. 

docker exec -it <container_name> /bin/bash

[root@localhost ~]# docker exec -it d88 /bin/bash /home/oracle/setup/dockerInit.sh
User check : root.
Start up Oracle Database
Last login: Fri May 26 07:20:07 UTC 2017
Fri May 26 07:21:13 UTC 2017
start database
start listener
The database is ready for use .
Fri May 26 07:18:51 UTC 2017
User check : root.
Setup Oracle Database
Fri May 26 07:21:13 UTC 2017
User check : root.
Start up Oracle Database…

This will take about 5 to 8 minutes to be up and running. You can check logs which are kept under /home/oracle/setup/log location.

You can verify log file placed under “/home/oracle/setup/log/setupDB.log“. If “Done ! The database is ready for use .” is shown, the database setup was successful.

Let us switch to oracle user and try testing the DB connectivity using SQLPLUS command:



Multitenant: Connecting to Container Databases (CDB) & Pluggable Databases (PDB) 

If you are new to Oracle D12c, the multitenant option introduced in Oracle Database 12c allows a single container database (CDB) to host multiple separate pluggable databases (PDB). I couldn’t just wait to test this out & see how to connect to container databases (CDB) and pluggable databases (PDB).

By default, PDB1 gets automatically created during the database installation. You can check that through the below command:


The V$SERVICES views can be used to display available services from the database as shown below:

Let us see how to connect to one of the container database.

Before you connect to the container database, let us setup a user first:

SQL> create user raina identified by raina;
User created.


SQL> grant dba to raina;
Grant succeeded.


SQL> grant create session to raina;
Grant succeeded.


SQL> grant connect to raina;
Grant succeeded.


SQL> conn raina/raina@pdb1

Follow the below commands to connect to PDB1 using the above user account:

SQL> ALTER SESSION SET container = pdb1;




SQL> conn raina/raina@pdb1




Hence, we are now connected to one of database container running inside Oracle Database Enterprise Edition.

In the future post, we will look how does Oracle Client Instant connect to Oracle Database Enterprise Docker container.





Spread the love
Categories: Docker

Ajeet Raina

My name is Ajeet Singh Raina and I am an author of this blogging site. I am a Docker Captain, ARM Innovator & Docker Bangalore Community Leader. I bagged 2 special awards last year(2019): Firstly, “The Tip of Captain’s Hat Award” at Dockercon 2019, San Francisco, and secondly, “2019 Docker Community Award“. I run Collabnix Community Slack with over 5300+ audience . I have built popular GITHUB repositories like DockerLabs, KubeLabs, Kubetools, RedisPlanet Terraform etc. with the support of Collabnix Community. Currently working as Developer Relations Manager at Redis Labs where I help customers and community members adopt Redis. With over 12,000+ followers over LinkedIn & close to 5100+ twitter followers, I like sharing Docker and Kubernetes related content . You can follow me on Twitter(@ajeetsraina) & GitHub(@ajeetraina)


mobsex.mobi · 5th June 2017 at 12:25 pm

I ᴡwas able to find good advice from your blog posts.

Carol · 21st June 2017 at 7:35 pm

It WORKED! This is CERTAINLY NOT a free standing gates!
She loved it!

uma bankolli · 26th July 2017 at 1:53 pm

hi I installed the oracle linux container on my centos machine. But when i try to start the dockerInit.sh as below it fails :
[root@18de1aec43ea /]# /bin/bash /home/oracle/setup/dockerInit.sh
Wed Jul 26 08:09:15 UTC 2017
User check : root.
User check : root.
Start up Oracle Database
Start up Oracle Database
from /========== file :startupDB.sh——-
Last login: Wed Jul 26 07:55:58 UTC 2017
su: cannot open session: Permission denied

Setup Oracle Database
basically i am not able to login to container as oracle user

[root@18de1aec43ea /]# su – oracle
Last login: Wed Jul 26 08:09:49 UTC 2017
su: cannot open session: Permission denied

So i am not able to proceed further, someone kindly help.

    Ajeet Singh Raina · 27th July 2017 at 8:44 am

    Can you use docker exec command instead of running it from inside the docker container?

uma bankolli · 2nd August 2017 at 11:05 am

[root@jaguar20 oracle]# docker start dockerDB121
[root@jaguar20 oracle]# docker exec -i -t dockerDB121 /bin/bash
[root@18de1aec43ea /]# su – oracle
Last login: Wed Aug 2 05:36:49 UTC 2017
su: cannot open session: Permission denied
[root@18de1aec43ea /]#

Leave a Reply

Your email address will not be published. Required fields are marked *

Join Collabnix SlackIt's 100% FREE!

Get chance to chat with 5500+ DevOps Engineers !