Docker Volume plugin for Pure Storage

You may have noticed that you can now download a Docker Volume Plugin for Pure Storage from the Docker Store. The Pure Storage Docker Volume plugin provides seamless integration with Docker containers, enabling persistent storage which is a must for many enterprise and database applications

Installation of the Docker Volume is extremely simple and is well documented at the Docker Store.

Once installed the first thing you must do is to let the Volume plugin know about your Pure FlashArray, update /etc/pure-docker-plugin/pure.json to use your FlashArray’s management (not iSCSI) IP address and API Token.

Starting pure-docker-plugin

You can now start the pure-docker-plugin using systemctl start e.g.

[root@z-oracle ~]#  systemctl start pure-docker-plugin

You can also check the log file using systemctl status e.g.

[root@z-oracle ~]#  systemctl status pure-docker-plugin -l

Create a Volume

You can create a Pure Storage FlashArray volume from your Linux server using the docker volume create command.

[root@z-oracle ~]# docker volume create –driver=pure -o size=100GB –name=ron101 –label=ron
ron101

You should now be able to see the newly created volume within the Pure Storage FlashArray.docke_FA

List a Volume

You can also use the docker volume ls command and filters to show available volumes.

[root@z-oracle ~]# docker volume ls -f name=ron
DRIVER              VOLUME NAME
pure                ron100
pure                ron101

Inspect a Volume

You can use the docker volume inspect command to get a bit more info and to also see where it’s being used.

[root@z-oracle ~]# docker volume inspect ron101
[
{
“Name”: “ron101”,
“Driver”: “pure”,
“Mountpoint”: “”,
“Labels”: {
“ron”: “”
},
“Scope”: “global”
}
]

When the Docker Volume is used the Mountpoint will be visible e.g.

[root@z-oracle ~]# docker volume inspect ron100
[
{
“Name”: “ron100”,
“Driver”: “pure”,
“Mountpoint”: “/pure-docker-mounts/z-oracle/ron100”,
“Labels”: {
“ron”: “”
},
“Scope”: “global”
}
]

Delete a Volume

The Pure Storage Volume plugin also supports volume delete.

[root@z-oracle ~]# docker volume rm ron101
ron101
[root@z-oracle ~]# docker volume ls -f name=ron
DRIVER              VOLUME NAME

In this Blog I have shared how we can create, inspect and delete Docker Volumes using the Pure Storage Docker Volume plug-in, in my next post I will share you you can use these volumes for persistent database storage.

Check-out the Pure Storage Developer Community for more examples.

Oracle 12c on Docker

Getting the Image

Great news, during DockerCon 2017 Oracle announced support for Oracle 12.1 Database Docker images. Press release: Oracle Brings Oracle’s Flagship Databases and Developer Tools to the Docker Store

Previously to run an Oracle Database in a Docker container you needed to create your own Docker image, I actually Blogged on this earlier in the year, if you interested you can read about it here.

However, you can now obtain an official Oracle 12.1 Database Docker images from the Docker Store

Before you can ‘pull’ the new Docker image you will need to login to the Docker Store and click on the ‘Get Content’ button and then complete the form, providing your name, company, phone number and then accepting the Oracle license agreement.

Docker_Store

The ‘Setup’ button provides details on how ‘pull’ the image and also how to set-up the your Oracle database within Docker.

docker pull store/oracle/database-enterprise:12.1.0.2

pull
The Docker image includes all the required Oracle files so is pretty large coming in at ~4.87GB, so it may take a while to download.

Running the Container

The environment file allows for customisation of the Database name, password, domain and feature bundle.

The command for creating a database container is:

$ docker run -d –env-file -p :1521 -p :5500 -it –name –shm-size=”4g”

Parameters:
<path_to_env_file> is the path to the environment file you created using above example.
<listener_port> is the port on host machine to map the container’s 1521 port (listener port).
<http_port> is the port on host machine to map the container’s 5500 port (http service port).
<container_name> is the container name you want to create.
<shared_memory_size> is the memory size for the container to run. The minimum requirement is 4GB (–shm-size=”4g”).
<image_name> is the image that you use to create a container.

In this example our environment file is called db_env.dat and our container is going to be called dockerDB

docker run -d –env-file ./db_env.dat -p 1527:1521 -p 5507:5500 -it –name dockerDB –shm-size=”8g” store/oracle/database-enterprise:12.1.0.2

We should now be able to see our new Oracle 12.1 image and running container using:

docker image ls
docker container ls

images

From my MacBook Pro we check the progress of the build using the Docker logs option e.g.

docker logs -f dockerDB

ready

We can also connect to the running container using the Docker exec command e.g.

docker exec -it dockerDB /bin/bash

oracle.png
From here we can see the Oracle Docker is using Oracle Linux 7.3 and the database is called ‘OraDoc’ as per our environment file.

As you can see from the above we are connected as root, if you want to use the oracle account then type ‘su – oracle’ and from there try out sqlplus inside your container.

database

Oracle 12c on an MBP Done!

Running Oracle 12.2.0.1 on Docker

Docker Installation

Before you can consider creating an Oracle Database docker container you need to install Docker. If you yet to install Docker you can visit one of my previous posts Docker installation on Oracle Linux 7.2  to get started.

Oracle on Docker

Since last year Oracle have provided build files to assist in the creation of Oracle Database Docker images. Gerald Venzl produced an excellent Blog post Creating an Oracle Database Docker Image for Oracle 12.1.0.2, however now that Oracle 12.2.0.1 is available for on-premises I thought I would try and and create an Oracle 12.2.0.1 container.

Please note, before you start deploying Oracle on Docker it’s probably advisable to check the latest Oracle support position for running Oracle on Docker (see below)
Oracle Support Document 2216342.1 (Oracle Support for Database Running on Docker)

Applies To:
Oracle Database – Enterprise Edition – Version 12.1.0.2 and later
Oracle Database – Standard Edition – Version 12.1.0.2 and later
Linux OS – Version Oracle Linux 7.3 to Oracle Linux 7.3 [Release OL7U3]
Linux x86-64
Details
Oracle will support customers running Oracle Database (single instance) in Docker containers. Oracle will only provide support when running the database in Docker containers running on Oracle Linux and Red Hat RHEL.  Supported versions of these Linux distributions are

  • Oracle Linux 7
  • Red Hat Enterprise Linux 7 (RHEL)

Oracle does not support Oracle Database running in a Real Application Clusters (RAC) configuration in Docker containers.

If your satisfied with your support position you will need the following:

The Oracle Database 12.2.0.1 zip file, which you can get from Oracle Technology Network and the Oracle Docker build files which you can download or clone from GitHub

For this Blog I am using my Vagrant managed Oracle Linux 7.3 Server

[vagrant@localhost ~]$ uname -r
4.1.12-61.1.28.el7uek.x86_64

[vagrant@localhost ~]$ cat /etc/oracle-release
Oracle Linux Server release 7.3

[vagrant@localhost ~]$ docker –version
Docker version 1.12.6, build ac13b2b

Preparation

If you plan to run the docker container out of an Oracle OS account you can use the oracle-database-server-12cR2-preinstall package to create your OS accounts and groups if missing.

I then edited the /etc/sysconfig/docker-storage file adding the following entry to increase the storage space available to my container.

DOCKER_STORAGE_OPTIONS=–storage-opt dm.basesize=20G

As my Vagrant VirtualBox OL73 server had a small root file system I added another 40G disk via VirtualBox for my Docker image via the loopback storage mounting at /var/lib/docker as this is where Docker will create the container file systems.

e.g.
service docker stop
fdisk /dev/sdb
mkfs.xfs /dev/sdb1
cd /var/lib
rm -Rf docker
mkdir docker
mount /dev/sdb1 /var/lib/docker
service docker start

To allow to Oracle to sudo and run docker commands I then added oracle to the /etc/sudoers file.

e.g.
visudo 
oracle ALL = NOPASSWD: ALL

You can now switch user to oracle (su – oracle) and download the Oracle build files and database zip file if you have not already obtained them

[oracle@localhost ~]$ wget https://github.com/oracle/docker-images/archive/master.zip
[oracle@localhost ~]$ unzip master.zip
[oracle@localhost ~]$ cd docker-images-master/OracleDatabase/dockerfiles/12.2.0.1/

Now copy linuxx64_12201_database.zip from its download location to the 12.2.0.1 directory.

Oracle Docker image creation

Usage: buildDockerImage.sh -v [version] [-e | -s | -x] [-i]
Builds a Docker Image for Oracle Database.

Parameters:
-v: version to build
Choose one of: 11.2.0.2  12.1.0.2  12.2.0.1
-e: creates image based on ‘Enterprise Edition’
-s: creates image based on ‘Standard Edition 2’
-x: creates image based on ‘Express Edition’
-i: ignores the MD5 checksums

* select one edition only: -e, -s, or -x

[oracle@localhost 12.2.0.1]$ cd ..
[oracle@localhost dockerfiles]$ sudo ./buildDockerImage.sh -v 12.2.0.1 -e
Checking if required packages are present and valid…
linuxx64_12201_database.zip: OK
==========================
DOCKER info:
Containers: 1
Running: 0
Paused: 0
Stopped: 1
Images: 6
Server Version: 1.12.6
Storage Driver: devicemapper
Pool Name: docker-8:17-134299776-pool
Pool Blocksize: 65.54 kB
Base Device Size: 21.47 GB
Backing Filesystem: xfs
Data file: /dev/loop0
Metadata file: /dev/loop1
Data Space Used: 3.62 GB
Data Space Total: 107.4 GB
Data Space Available: 35.81 GB
Metadata Space Used: 2.535 MB
Metadata Space Total: 2.147 GB
Metadata Space Available: 2.145 GB
Thin Pool Minimum Free Space: 10.74 GB
Udev Sync Supported: true
Deferred Removal Enabled: false
Deferred Deletion Enabled: false
Deferred Deleted Device Count: 0
Data loop file: /var/lib/docker/devicemapper/devicemapper/data
WARNING: Usage of loopback devices is strongly discouraged for production use. Use `–storage-opt dm.thinpooldev` to specify a custom block storage device.
Metadata loop file: /var/lib/docker/devicemapper/devicemapper/metadata
Library Version: 1.02.135-RHEL7 (2016-09-28)
Logging Driver: json-file

==========================
Building image ‘oracle/database:12.2.0.1-ee’ …
Sending build context to Docker daemon 3.454 GB
Step 1 : FROM oraclelinux:7-slim
7-slim: Pulling from library/oraclelinux
33a3a5e469a8: Pull complete
Digest: sha256:f3a78afd456061bb897b9f2b54b568dec3973efccf2b086d602fabb94069fb6d
Status: Downloaded newer image for oraclelinux:7-slim
—> f005b5220b05
Step 2 : MAINTAINER Gerald Venzl <gerald.venzl@oracle.com>
—> Running in 64041116d1b3
—> 7cf919c3ab70
Removing intermediate container 64041116d1b3
Step 3 : ENV ORACLE_BASE /opt/oracle ORACLE_HOME /opt/oracle/product/12.2.0.1/dbhome_1 INSTALL_FILE_1 “linuxx64_12201_database.zip” INSTALL_RSP “db_inst.rsp” CONFIG_RSP “dbca.rsp.tmpl” PWD_FILE “setPassword.sh” PERL_INSTALL_FILE “installPerl.sh” RUN_FILE “runOracle.sh” START_FILE “startDB.sh” CREATE_DB_FILE “createDB.sh” SETUP_LINUX_FILE “setupLinuxEnv.sh” CHECK_SPACE_FILE “checkSpace.sh” INSTALL_DB_BINARIES_FILE “installDBBinaries.sh”
—> Running in 25142567c49e
—> 35ff7ea319fa
Removing intermediate container 25142567c49e
Step 4 : ENV INSTALL_DIR $ORACLE_BASE/install PATH $ORACLE_HOME/bin:$ORACLE_HOME/OPatch/:/usr/sbin:$PATH LD_LIBRARY_PATH $ORACLE_HOME/lib:/usr/lib CLASSPATH $ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib
—> Running in 2b0c17414781
—> 1eb28b0769f2
Removing intermediate container 2b0c17414781
Step 5 : COPY $INSTALL_FILE_1 $INSTALL_RSP $PERL_INSTALL_FILE $SETUP_LINUX_FILE $CHECK_SPACE_FILE $INSTALL_DB_BINARIES_FILE $INSTALL_DIR/
—> aff425e9295c
Removing intermediate container 8f310fa167cf
Step 6 : COPY $RUN_FILE $START_FILE $CREATE_DB_FILE $CONFIG_RSP $PWD_FILE $ORACLE_BASE/
—> 30a46bcfb092
Removing intermediate container 392cda966aaf
Step 7 : RUN chmod ug+x $INSTALL_DIR/*.sh && sync && $INSTALL_DIR/$CHECK_SPACE_FILE && $INSTALL_DIR/$SETUP_LINUX_FILE
—> Running in ce2d69a6fc72
Loaded plugins: ovl
Resolving Dependencies

Complete!
Loaded plugins: ovl
Cleaning repos: ol7_UEKR4 ol7_latest
Cleaning up everything
—> 4cc34d72a3be
Removing intermediate container ce2d69a6fc72
Step 8 : USER oracle
—> Running in 012bc240b15c
—> 90c7fd83f732
Removing intermediate container 012bc240b15c
Step 9 : RUN $INSTALL_DIR/$INSTALL_DB_BINARIES_FILE EE
—> Running in a669bd56a701
Archive: linuxx64_12201_database.zip
creating: database/

inflating: database/runInstaller
Starting Oracle Universal Installer…

Checking Temp space: must be greater than 500 MB. Actual 16493 MB Passed
Checking swap space: must be greater than 150 MB. Actual 4095 MB Passed
Preparing to launch Oracle Universal Installer from /tmp/OraInstall2017-03-27_03-55-03PM. Please wait …[WARNING] [INS-32055] The Central Inventory is located in the Oracle base.
ACTION: Oracle recommends placing this Central Inventory in a location outside the Oracle base directory.
You can find the log of this install session at:
/opt/oracle/oraInventory/logs/installActions2017-03-27_03-55-03PM.log
The installation of Oracle Database 12c was successful.
Please check ‘/opt/oracle/oraInventory/logs/silentInstall2017-03-27_03-55-03PM.log’ for more details.

As a root user, execute the following script(s):
1. /opt/oracle/oraInventory/orainstRoot.sh
2. /opt/oracle/product/12.2.0.1/dbhome_1/root.sh

Successfully Setup Software.

This is perl 5, version 22, subversion 0 (v5.22.0) built for x86_64-linux-thread-multi

Copyright 1987-2015, Larry Wall

Perl may be copied only under the terms of either the Artistic License or the
GNU General Public License, which may be found in the Perl 5 source kit.

Complete documentation for Perl, including FAQ lists, should be found on
this system using “man perl” or “perldoc perl”. If you have access to the
Internet, point your browser at http://www.perl.org/, the Perl Home Page.

—> 0902cfc62543
Removing intermediate container a669bd56a701
Step 10 : USER root
—> Running in 29796c72580a
—> 09b24f80b740
Removing intermediate container 29796c72580a
Step 11 : RUN $ORACLE_BASE/oraInventory/orainstRoot.sh && $ORACLE_HOME/root.sh && rm -rf $INSTALL_DIR
—> Running in b4e812ee2e1b
Changing permissions of /opt/oracle/oraInventory.
Adding read,write permissions for group.
Removing read,write,execute permissions for world.

Changing groupname of /opt/oracle/oraInventory to dba.
The execution of the script is complete.
Check /opt/oracle/product/12.2.0.1/dbhome_1/install/root_d301de87c50a_2017-03-27_16-01-04-445406140.log for the output of root script
—> afc8f9ef0a10
Removing intermediate container b4e812ee2e1b
Step 12 : USER oracle
—> Running in 6244a9a22dec
—> 8a41f54d71ae
Removing intermediate container 6244a9a22dec
Step 13 : WORKDIR /home/oracle
—> Running in c52fa2e4164f
—> b9daa3897d15
Removing intermediate container c52fa2e4164f
Step 14 : VOLUME $ORACLE_BASE/oradata
—> Running in 847ca5208e7f
—> 2f897f1adbda
Removing intermediate container 847ca5208e7f
Step 15 : EXPOSE 1521 5500
—> Running in d73768c39961
—> 9fd63d1fd413
Removing intermediate container d73768c39961
Step 16 : CMD exec $ORACLE_BASE/$RUN_FILE
—> Running in 34d6f31bb5b7
—> efa2e9d7cc87
Removing intermediate container 34d6f31bb5b7
Successfully built efa2e9d7cc87

Oracle Database Docker Image for ‘ee’ version 12.2.0.1 is ready to be extended:

–> oracle/database:12.2.0.1-ee

Build completed in 840 seconds.

Starting Oracle Docker instance

We are now ready to start the Oracle databases inside a Docker container. To do this we use the docker run command passing the required parameters.

e.g.
-p Port
–name Docker container name, note this is not the database name.

[oracle@localhost dockerfiles]$ sudo docker run -p 1521:1521 –name pure oracle/database:12.2.0.1-ee
ORACLE AUTO GENERATED PASSWORD FOR SYS, SYSTEM AND PDBAMIN: FH0EoJP7dYo=1

LSNRCTL for Linux: Version 12.2.0.1.0 – Production on 27-MAR-2017 16:10:45

Copyright (c) 1991, 2016, Oracle.  All rights reserved.

Starting /opt/oracle/product/12.2.0.1/dbhome_1/bin/tnslsnr: please wait…

TNSLSNR for Linux: Version 12.2.0.1.0 – Production
System parameter file is /opt/oracle/product/12.2.0.1/dbhome_1/network/admin/listener.ora
Log messages written to /opt/oracle/diag/tnslsnr/f4c614207382/listener/alert/log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1)))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=0.0.0.0)(PORT=1521)))
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1)))
STATUS of the LISTENER
————————
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 12.2.0.1.0 – Production
Start Date                27-MAR-2017 16:10:45
Uptime                    0 days 0 hr. 0 min. 0 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /opt/oracle/product/12.2.0.1/dbhome_1/network/admin/listener.ora
Listener Log File         /opt/oracle/diag/tnslsnr/f4c614207382/listener/alert/log.xml
Listening Endpoints Summary…
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=0.0.0.0)(PORT=1521)))
The listener supports no services
The command completed successfully
[WARNING] [DBT-10102] The listener configuration is not selected for the database. EM DB Express URL will not be accessible.
CAUSE: The database should be registered with a listener in order to access the EM DB Express URL.
ACTION: Select a listener to be registered or created with the database.
Copying database files
1% complete
13% complete
25% complete
Creating and starting Oracle instance
26% complete
30% complete
31% complete
35% complete
38% complete
39% complete
41% complete
Completing Database Creation
42% complete
43% complete
44% complete
46% complete
47% complete
50% complete
Creating Pluggable Databases
55% complete
75% complete
Executing Post Configuration Actions
100% complete
Look at the log file “/opt/oracle/cfgtoollogs/dbca/ORCLCDB/ORCLCDB.log” for further details.

SQL*Plus: Release 12.2.0.1.0 Production on Mon Mar 27 16:17:18 2017

Copyright (c) 1982, 2016, Oracle.  All rights reserved.

Connected to:
Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 – 64bit Production

SQL>
System altered.

SQL>
Pluggable database altered.

SQL> Disconnected from Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 – 64bit Production
#########################
DATABASE IS READY TO USE!
#########################
Completed: alter pluggable database ORCLPDB1 open
2017-03-27T16:17:17.923085+00:00
ORCLPDB1(3):CREATE SMALLFILE TABLESPACE “USERS” LOGGING DATAFILE ‘/opt/oracle/oradata/ORCLCDB/ORCLPDB1/users01.dbf’ SIZE 5M REUSE AUTOEXTEND ON NEXT 1280K MAXSIZE UNLIMITED EXTENT MANAGEMENT LOCAL SEGMENT SPACE MANAGEMENT AUTO
ORCLPDB1(3):Completed: CREATE SMALLFILE TABLESPACE “USERS” LOGGING DATAFILE ‘/opt/oracle/oradata/ORCLCDB/ORCLPDB1/users01.dbf’ SIZE 5M REUSE AUTOEXTEND ON NEXT 1280K MAXSIZE UNLIMITED EXTENT MANAGEMENT LOCAL SEGMENT SPACE MANAGEMENT AUTO
ORCLPDB1(3):ALTER DATABASE DEFAULT TABLESPACE “USERS”
ORCLPDB1(3):Completed: ALTER DATABASE DEFAULT TABLESPACE “USERS”
2017-03-27T16:17:18.753847+00:00
ALTER SYSTEM SET control_files=’/opt/oracle/oradata/ORCLCDB/control01.ctl’ SCOPE=SPFILE;
ALTER PLUGGABLE DATABASE ORCLPDB1 SAVE STATE
Completed: ALTER PLUGGABLE DATABASE ORCLPDB1 SAVE STATE
2017-03-27T16:27:02.711804+00:00
ORCLPDB1(3):Resize operation completed for file# 10, old size 337920K, new size 358400K

Resetting the Oracle Database passwords

During the build a default password was allocated, however it’s a good idea to update the passwords now, fortunately the build includes a utility to update the Oracle SYS, SYSYEM & PDBADMIN.

[oracle@localhost dockerfiles]$ sudo docker exec pure ./setPassword.sh Docker
The Oracle base remains unchanged with value /opt/oracle

SQL*Plus: Release 12.2.0.1.0 Production on Tue Mar 28 14:56:13 2017

Copyright (c) 1982, 2016, Oracle.  All rights reserved.

Connected to:
Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 – 64bit Production

SQL>
User altered.

SQL>
User altered.

SQL>
Session altered.

SQL>
User altered.

SQL> Disconnected from Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 – 64bit Production

Stopping the Oracle Database Docker

[oracle@localhost dockerfiles]$ sudo docker stop pure
pure

[oracle@localhost dockerfiles]$ sudo docker ps
CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS               NAMES

Restarting the Oracle Database Docker

[oracle@localhost dockerfiles]$ sudo docker ps
CONTAINER ID        IMAGE                         COMMAND                  CREATED             STATUS              PORTS                              NAMES

f4c614207382        oracle/database:12.2.0.1-ee   “/bin/sh -c ‘exec $OR”   22 hours ago        Up 2 seconds        0.0.0.0:1521->1521/tcp, 5500/tcp   pure

[oracle@localhost bin]$ ./sql system/Docker@//localhost:1521/ORCLPDB1

SQLcl: Release 4.2.0 Production on Tue Mar 28 15:20:02 2017

Copyright (c) 1982, 2017, Oracle.  All rights reserved.

Last Successful login time: Tue Mar 28 2017 15:20:03 +00:00

Connected to:
Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 – 64bit Production

SQL> select name from v$database;

NAME
———
ORCLCDB

SQL>

Using the Docker Log

The docker logs command will perform a tail -f of /opt/oracle/diag/rdbms/orclcdb/ORCLCDB/trace/alert_ORCLCDB.log which can be useful to diagnose problems or just to review status.

[oracle@localhost ~]$ sudo docker logs -f pure
ORACLE AUTO GENERATED PASSWORD FOR SYS, SYSTEM AND PDBAMIN: FH0EoJP7dYo=1

LSNRCTL for Linux: Version 12.2.0.1.0 – Production on 27-MAR-2017 16:10:45

Copyright (c) 1991, 2016, Oracle. All rights reserved.

Starting /opt/oracle/product/12.2.0.1/dbhome_1/bin/tnslsnr: please wait…

TNSLSNR for Linux: Version 12.2.0.1.0 – Production
System parameter file is /opt/oracle/product/12.2.0.1/dbhome_1/network/admin/listener.ora
Log messages written to /opt/oracle/diag/tnslsnr/f4c614207382/listener/alert/log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1)))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=0.0.0.0)(PORT=1521)))

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1)))
STATUS of the LISTENER
————————
Alias LISTENER
Version TNSLSNR for Linux: Version 12.2.0.1.0 – Production
Start Date 27-MAR-2017 16:10:45
Uptime 0 days 0 hr. 0 min. 0 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /opt/oracle/product/12.2.0.1/dbhome_1/network/admin/listener.ora
Listener Log File /opt/oracle/diag/tnslsnr/f4c614207382/listener/alert/log.xml
Listening Endpoints Summary…
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=0.0.0.0)(PORT=1521)))
The listener supports no services
The command completed successfully
The docker start command runs the container automatically into the background.

Docker installation on Oracle Linux 7.2

Oracle Linux 7.2 Installation

To get ready for this Blog I performed a standard Linux 7.2 installation, during the ‘Software Selection’ part of the wizard selected ‘Base Environent’ of ‘Server with GUI’ and the following ‘Add-Ons for Selected Evironment’

  • Compatibility Libraries
  • Development Tools

If you need further install details, I have a seperate Blog posting on performing an Oracle Linux 7.2 installation.

Kernel Upgrade

The Oracle Linux R7 Update 2 ships with a 3.8.13 Kernel however Docker requires a Kernel of 4.1.12 or higher on Oracle Linux, this kernel supports the Docker btrfs storage engine on both Oracle Linux 6 and 7.

Oracle Linux Docker Prerequisites

With yum this is easliy fixed,  by telling yum to use the release 4 Kernel repository.

[root@oel7 ~]# uname -r
3.8.13-98.7.1.el7uek.x86_64

[root@oel7 ~]# yum list kernel-uek*
Loaded plugins: langpacks, ulninfo
Installed Packages
kernel-uek.x86_64                            3.8.13-98.7.1.el7uek        @anaconda/7.2
kernel-uek-devel.x86_64                3.8.13-98.7.1.el7uek       @anaconda/7.2
kernel-uek-firmware.noarch         3.8.13-98.7.1.el7uek       @anaconda/7.2
Available Packages
kernel-uek.x86_64                             3.8.13-118.10.2.el7uek   ol7_UEKR3
kernel-uek-debug.x86_64               3.8.13-118.10.2.el7uek   ol7_UEKR3
kernel-uek-debug-devel.x86_64  3.8.13-118.10.2.el7uek   ol7_UEKR3
kernel-uek-devel.x86_64                3.8.13-118.10.2.el7uek   ol7_UEKR3
kernel-uek-doc.noarch                     3.8.13-118.10.2.el7uek   ol7_UEKR3
kernel-uek-firmware.noarch          3.8.13-118.10.2.el7uek   ol7_UEKR3

OK, lets tell yum to use our new repository

[root@oel7 ~]# vi /etc/yum.repos.d/public-yum-ol7.repo

[ol7_UEKR3]
name=Latest Unbreakable Enterprise Kernel Release 3 for Oracle Linux $releasever ($basearch)
baseurl=http://public-yum.oracle.com/repo/OracleLinux/OL7/UEKR3/$basearch/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
gpgcheck=1
enabled=0

[ol7_UEKR4]
name=Latest Unbreakable Enterprise Kernel Release 4 for Oracle Linux $releasever ($basearch)
baseurl=http://public-yum.oracle.com/repo/OracleLinux/OL7/UEKR4/$basearch/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
gpgcheck=1
enabled=1

[ol7_addons]
name=Oracle Linux $releasever Add ons ($basearch)
baseurl=http://public-yum.oracle.com/repo/OracleLinux/OL7/addons/$basearch/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
gpgcheck=1
enabled=1

As you can see from above I have disabled ol7_UEKR3, enabled the ol7_addons and added a new section form ol7_UEKR4, we can now use yum to pick up the new 4.1.12 Kernel.

[root@oel7 ~]# yum list kernel-uek*
Loaded plugins: langpacks, ulninfo
Installed Packages
kernel-uek.x86_64                             3.8.13-98.7.1.el7uek  @anaconda/7.2
kernel-uek-devel.x86_64                3.8.13-98.7.1.el7uek  @anaconda/7.2
kernel-uek-firmware.noarch         3.8.13-98.7.1.el7uek  @anaconda/7.2
Available Packages
kernel-uek.x86_64                             4.1.12-37.6.3.el7uek  ol7_UEKR4
kernel-uek-debug.x86_64               4.1.12-37.6.3.el7uek  ol7_UEKR4
kernel-uek-debug-devel.x86_64  4.1.12-37.6.3.el7uek  ol7_UEKR4
kernel-uek-devel.x86_64                4.1.12-37.6.3.el7uek  ol7_UEKR4
kernel-uek-doc.noarch                    4.1.12-37.6.3.el7uek  ol7_UEKR4
kernel-uek-firmware.noarch         4.1.12-37.6.3.el7uek  ol7_UEKR4

Ok lets let yum do it’s thing.
[root@oel7 ~]# yum update

Time for a coffee…

SELinux support on Oracle Linux 7

Docker requires SElinux to be set to Permissive or Disabled in /etc/sysconfig/selinux to use the btrfs storage engine on Oracle Linux 7, so lets change it now if not already set before we reboot.

[root@oel7 ~]# vi /etc/sysconfig/selinux

SELINUX=permissive

[root@oel7 ~]# setenforce Permissive

Reboot to pick up the new 4.1.12 Kernel

[root@oel7 ~]# uname -r
4.1.12-37.6.3.el7uek.x86_64

Docker 1.10

As we have updated the yum repository to use ol7_addons we can now install the docker engine.

[root@oel7 ~]# yum list docker-engine
Loaded plugins: langpacks, ulninfo
Available Packages
docker-engine.x86_64             1.10.3-1.0.3.el7   ol7_addons

[root@oel7 ~]# yum install docker-engine
Loaded plugins: langpacks, ulninfo
Resolving Dependencies
–> Running transaction check
—> Package docker-engine.x86_64 0:1.10.3-1.0.3.el7 will be installed
–> Processing Dependency: docker-engine-selinux >= %{epoch}:1.10.3-1.0.3.el7 for package: docker-engine-1.10.3-1.0.3.el7.x86_64
–> Running transaction check
—> Package docker-engine-selinux.noarch 0:1.10.3-1.0.3.el7 will be installed
–> Finished Dependency Resolution

Dependencies Resolved

================================================================================================================================================
Package Arch Version Repository Size
================================================================================================================================================
Installing:
docker-engine x86_64 1.10.3-1.0.3.el7 ol7_addons 9.6 M
Installing for dependencies:
docker-engine-selinux noarch 1.10.3-1.0.3.el7 ol7_addons 28 k

Transaction Summary
================================================================================================================================================
Install 1 Package (+1 Dependent package)

Total download size: 9.6 M
Installed size: 41 M
Is this ok [y/d/N]: y
Downloading packages:
(1/2): docker-engine-selinux-1.10.3-1.0.3.el7.noarch.rpm | 28 kB 00:00:05
(2/2): docker-engine-1.10.3-1.0.3.el7.x86_64.rpm | 9.6 MB 00:00:13
————————————————————————————————————————————————
Total 710 kB/s | 9.6 MB 00:00:13
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : docker-engine-selinux-1.10.3-1.0.3.el7.noarch 1/2
Installing : docker-engine-1.10.3-1.0.3.el7.x86_64 2/2
Verifying : docker-engine-1.10.3-1.0.3.el7.x86_64 1/2
Verifying : docker-engine-selinux-1.10.3-1.0.3.el7.noarch 2/2

Installed:
docker-engine.x86_64 0:1.10.3-1.0.3.el7

Dependency Installed:
docker-engine-selinux.noarch 0:1.10.3-1.0.3.el7

Complete!

[root@oel7 ~]# docker –version
Docker version 1.10.3, build 57bf6fd

Docker Installation Check

First let’s start the service

[root@oel7 ~]# systemctl start docker.service

Now we can check the docker with the ‘Hello World’ container.
[root@oel7 ~]# docker run hello-world
Unable to find image ‘hello-world:latest’ locally
latest: Pulling from library/hello-world
c04b14da8d14: Pull complete
Digest: sha256:0256e8a36e2070f7bf2d0b0763dbabdd67798512411de4cdcf9431a1feb60fd9
Status: Downloaded newer image for hello-world:latest

Hello from Docker!
This message shows that your installation appears to be working correctly.

To generate this message, Docker took the following steps:
1. The Docker client contacted the Docker daemon.
2. The Docker daemon pulled the “hello-world” image from the Docker Hub.
3. The Docker daemon created a new container from that image which runs the
executable that produces the output you are currently reading.
4. The Docker daemon streamed that output to the Docker client, which sent it
to your terminal.

To try something more ambitious, you can run an Ubuntu container with:
$ docker run -it ubuntu bash

Share images, automate workflows, and more with a free Docker Hub account:
https://hub.docker.com

For more examples and ideas, visit:
https://docs.docker.com/engine/userguide/

Docker 1.12

If you want to use a slighty new version of docker you can go directly to the docker projects own yum repository, the Docker install check step is the same.

[root@oel7 ~]# cd /etc/yum.repos.d/
[root@oel7 yum.repos.d]# vi docker.repo
[dockerrepo]
name=Docker Repository
baseurl=https://yum.dockerproject.org/repo/main/oraclelinux/7
enabled=1
gpgcheck=1
gpgkey=https://yum.dockerproject.org/gpg

[root@oel7 yum.repos.d]# yum list docker-engine
Loaded plugins: langpacks, ulninfo
Available Packages
docker-engine.x86_64             1.12.0-1.el7       dockerrepo

[root@oel7 ~]# yum install docker-engine
Loaded plugins: langpacks, ulninfo
Resolving Dependencies
–> Running transaction check
—> Package docker-engine.x86_64 0:1.12.0-1.el7 will be installed
–> Processing Dependency: docker-engine-selinux >= 1.12.0-1.el7 for package: docker-engine-1.12.0-1.el7.x86_64
–> Running transaction check
—> Package docker-engine-selinux.noarch 0:1.12.0-1.el7 will be installed
–> Finished Dependency Resolution

Dependencies Resolved

=============================================================================================================================================================================
Package Arch Version Repository Size
=============================================================================================================================================================================
Installing:
docker-engine x86_64 1.12.0-1.el7 dockerrepo 19 M
Installing for dependencies:
docker-engine-selinux noarch 1.12.0-1.el7 dockerrepo 28 k

Transaction Summary
=============================================================================================================================================================================
Install 1 Package (+1 Dependent package)

Total download size: 19 M
Installed size: 79 M
Is this ok [y/d/N]: y
Downloading packages:
warning: /var/cache/yum/x86_64/7Server/dockerrepo/packages/docker-engine-selinux-1.12.0-1.el7.noarch.rpm: Header V4 RSA/SHA512 Signature, key ID 2c52609d: NOKEY00:00:34 ETA
Public key for docker-engine-selinux-1.12.0-1.el7.noarch.rpm is not installed
(1/2): docker-engine-selinux-1.12.0-1.el7.noarch.rpm | 28 kB 00:00:06
(2/2): docker-engine-1.12.0-1.el7.x86_64.rpm | 19 MB 00:00:22
—————————————————————————————————————————————————————————–
Total 851 kB/s | 19 MB 00:00:22
Retrieving key from https://yum.dockerproject.org/gpg
Importing GPG key 0x2C52609D:
Userid : “Docker Release Tool (releasedocker) <docker@docker.com>”
Fingerprint: 5811 8e89 f3a9 1289 7c07 0adb f762 2157 2c52 609d
From : https://yum.dockerproject.org/gpg
Is this ok [y/N]: y
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : docker-engine-selinux-1.12.0-1.el7.noarch 1/2
restorecon: lstat(/var/lib/docker) failed: No such file or directory
warning: %post(docker-engine-selinux-1.12.0-1.el7.noarch) scriptlet failed, exit status 255
Non-fatal POSTIN scriptlet failure in rpm package docker-engine-selinux-1.12.0-1.el7.noarch
Installing : docker-engine-1.12.0-1.el7.x86_64 2/2
Verifying : docker-engine-selinux-1.12.0-1.el7.noarch 1/2
Verifying : docker-engine-1.12.0-1.el7.x86_64 2/2

Installed:
docker-engine.x86_64 0:1.12.0-1.el7

Dependency Installed:
docker-engine-selinux.noarch 0:1.12.0-1.el7

Complete!

[root@oel7 ~]# docker –version
Docker version 1.12.0, build 8eab29e