Oracle Database on the Docker Store

You probably know that there’s an official github repository storing Dockerfiles and samples to build Docker images for Oracle products and Open Source projects. Now Oracle takes one more step to support Docker. Oracle Brings Oracle’s Flagship Databases and Developer Tools to the Docker Store (you can read the official announcement). Oracle Linux was already on the Docker Store. Oracle Database 12.1.0.2 Enterprise Edition, Oracle client tools, Oracle Weblogic, Oracle Coherence, Java 8 SE are also released on the Docker Store. Now you don’t need to build the image, you can download and use the image from the Docker Store.

To be able to use them, first you need to login to the Docker Store, select the Docker Image you want and click “get content” button. Then the Docker store will ask you enter your contact information (name, phone, company etc), and you have to accept “the Oracle license agreement”.

When we complete the form, we see the instructions (and a sample environment file) to use it. The environment file sets the required parameters such as database SID, password. So now we’re ready to get the image.

I login to the docker (using command line) and pull the image:

Then, I copied the sample environment file, modified the password, SID and domain, and run the docker image (my environment file name is testere.dat and my image name is testere):

Be careful that the shm-size must be 4g or higher.

One of the good thing is, we do not need to provide Oracle Database installation files for these images. Oracle put the all required files into the repository images. You may need to increase the memory resources of Docker. When I run the above command, I see that container created instantly but infact it requires to unzip the database software and create the database during on the first run. I waited for a while and followed the logs:

It’s done. I examined these logs and see that the scripts had some “ignorable” errors about patching. I also see that the database is a container database and it comes with a pluggable database named “PDB1”.

I connected my test database running on Docker, using my favorite SQL client (Oracle SQL Developer) and checked the status. Everything looks OK.

Please share this post Share on Facebook0Share on Google+0Share on LinkedIn0Share on Reddit0Tweet about this on Twitter

Gokhan Atil is a database administrator who has hands-on experience with both RDBMS and noSQL databases (Oracle, PostgreSQL, Microsoft SQL Server, Sybase IQ, MySQL, Cassandra, MongoDB and ElasticSearch), and strong background on software development. He is certified as Oracle Certified Professional (OCP) and is awarded as Oracle ACE (in 2011) and Oracle ACE Director (in 2016) for his continuous contributions to the Oracle users community.

10 Comments

  1. Sumesh

    When I tried to pull the Oracle Database image, I am getting the below error

    [skb@slc]$ docker pull store/oracle/database-enterprise:12.1.0.2
    Pulling repository docker.io/store/oracle/database-enterprise
    Error: image store/oracle/database-enterprise:12.1.0.2 not found
    [skb@slc]$

    Do you know whether the location has changed for Oracle Database?

     

    • Gokhan Atil

      Have you accepted the license agreement and logged in to docker before you try to pull the image. As I see, the URL is working.

  2. Sumesh

    I copy pasted the command from the blog, but when I manually typed the ‘docker pull’ command it worked.

    [skbalakr@slc12mlv emga]$ docker pull store/oracle/database-enterprise:12.1.0.2
    12.1.0.2: Pulling from store/oracle/database-enterprise
    1eb8a4da372d: Pull complete
    f86d07afdaca: Downloading [============================================> ] 73.53 MB/83.33 MB
    39b78f36bb3e: Download complete
    fb6f62c61831: Download complete
    632559a5a84b: Download complete
    9a124bc4d5d2: Download complete

    Thanks.

  3. Sumesh

    When running the Database create command, I am getting the below error

    [skl@s3]$ docker run -d –env-file ./db_env_file.dat -p 1521:1521 -p 5500:5500 -it –name skbdockerDB –shm-size=”6g” store/oracle/database-enterprise:12.1.0.2
    flag provided but not defined: –shm-size
    See ‘docker run –help’.

    Any idea why I am getting the above error

    • Gokhan Atil

      It might be syntax error. You need to use dash dash (–) instead of long dash (Microsoft Word style).

      Be sure that you copy the text using the copy button on code window.

  4. Sumesh

    Thanks, Gokhan.

    I have used dash dash only, but when I pasted the command in the blog it turned out as a long dash.

    When checking in the GitHub forums, I see starting from Docker 1.8 version the option ‘-d’ is deprecated.

    Reference: https://github.com/moby/moby/issues/20081

    I am still searching into the docs and if I come to know of any solution, I will update here.

  5. Sumesh

    This time it’s complaining about the ‘shared memory size’

    [slc12mlv em]$ docker run -d –env-file /sc/db_env_file.dat -p 1521:1521 -p 5500:5500 -it –name skbdockerDB –shm-size=4g store/oracle/database-enterprise:12.1.0.2
    flag provided but not defined: –shm-size
    See ‘docker run –help’.

  6. Srikanth Reddy K

    Great article. Could you please attach ENV file as well for my reference.? Or you can send me the file to my e-mail if possible. Thanks.

Leave Comment

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