OCI-c: How to install docker on OL6

Provision an instance with EL 6.8 uek4 (uek4.1 or higher is a requirement for the docker package to install) with 50GB additional block storage.

Installation prerequisites

Login with opc

Update /etc/yum.repos.d/public-yum-ol6repo to enable ol6_addons

Create an oracle:oinstall user

Configure the extra volume on /u01, owned by oracle:oinstall

Docker installation and setup

Install docker and md5:

sudo yum install docker-engine md5

Change the following settings in the file /etc/sysconfig/docker for the 12.2 database to properly install:

[vi /etc/sysconfig/docker]
other_args="-g /u01/docker --storage-opt dm.basesize=40G"

Start docker:

sudo service docker start

Check that the system is property configured ‘in particular the ‘Data loop file’ and ‘Base Devise Size’ parameters.

docker info

Connected with oracle,download the docker build images on /u01, unzip the file, then download the 12.2 standard edition installation media into the 12.2 directory

cd /u01
wget https://github.com/oracle/docker-images/archive/master.zip
unzip master.zip
cd /u01/docker-images-master/OracleDatabase/dockerfiles/12.2.0.1
wget http://download.oracle.com/otn/linux/oracle12c/122010/linuxx64_12201_database.zip

Create the Oracle database docker image for 12.2

Build the docker image for the standard edition (this is the -s)

cd /u01/docker-images-master/OracleDatabase/dockerfiles
sudo ./buildDockerImage.sh -v 12.2.0.1 -s
 
. . .
Oracle Database Docker Image for 'se2' version 12.2.0.1 is ready to be extended:
--> oracle/database:12.2.0.1-se2
Build completed in 2186 seconds.

Create the containers

Create the first database container. Note that the password get generated automatically. Take a note of the displayed passwords:

sudo docker run -p 1531:1521 --name db01 -e oracle_pdb=pdb01 oracle/database:12.2.0.1-se2
ORACLE AUTO GENERATED PASSWORD FOR SYS, SYSTEM AND PDBAMIN: /N1H6CgQZV70=1
...
...

Create a second database container for process validation purpose:

sudo docker run -p 1532:1521 --name db01 -e oracle_pdb=pdb02 oracle/database:12.2.0.1-se2
ORACLE AUTO GENERATED PASSWORD FOR SYS, SYSTEM AND PDBAMIN: /N1H6CgQZV70=1
...
...

Change the password to respectively welcome1 and welcome2

sudo docker exec db01 ./setPassword.sh welcome1

sudo docker exec db02 ./setPassword.sh welcome2

Login to each database with the instant client by referencing the external port.

export LD_LIBRARY_PATH=/usr/lib/oracle/12.2/client64/lib
export PATH=/usr/lib/oracle/12.2/client64/bin:$PATH

sqlplus system/welcome1@localhost:1531/pdb01

sqlplus system/welcome1@localhost:1532/pdb02