Oracle Linux 7 Install Docker

/ Comments off

May 05, 2017 1 thought on “Installing docker on Oracle Linux 7” Pingback: fences look. Leave a Reply Cancel reply. Enter your comment here. Jul 15, 2017 In the example below, I'm using Oracle Linux yum server to provide the software updates. With a few quick steps, you'll be able to install the latest Docker release. First, update your Oracle Linux 7 instance with correct yum setting. To install the latest Docker release (17.03.1.ce), you need ol7latest, ol7uekr4 and ol7addons enabled. I have figure out some different way to install Oracle instant client in ubuntu Docker, it might help others. Follow these simple steps: Download oracle instant client (.rpm file) from oracle official download center. Convert into.deb (you can use apt-get install alien) and move somewhere in your working directory. Now Update your Dockerfile.

  1. Oracle Linux 7 Install Docker Compose
  2. Oracle Linux 7 Install Docker Tutorial
  3. Oracle Linux 7 Install Docker Windows 10
  4. Oracle Linux 7 Install Docker Manual
  • Docker Tutorial
  • Docker Useful Resources
  • Selected Reading

To start the installation of Docker, we are going to use an Ubuntu instance. You can use Oracle Virtual Box to setup a virtual Linux instance, in case you don’t have it already.

The following screenshot shows a simple Ubuntu server which has been installed on Oracle Virtual Box. There is an OS user named demo which has been defined on the system having entire root access to the sever.

To install Docker, we need to follow the steps given below.

Step 1 − Before installing Docker, you first have to ensure that you have the right Linux kernel version running. Docker is only designed to run on Linux kernel version 3.8 and higher. We can do this by running the following command.


This method returns the system information about the Linux system.



a − This is used to ensure that the system information is returned.

Return Value

This method returns the following information on the Linux system −

  • kernel name
  • node name
  • kernel release
  • kernel version
  • machine
  • processor
  • hardware platform
  • operating system



When we run above command, we will get the following result −

From the output, we can see that the Linux kernel version is 4.2.0-27 which is higher than version 3.8, so we are good to go.

Step 2 − You need to update the OS with the latest packages, which can be done via the following command −

This method installs packages from the Internet on to the Linux system.


sudo apt-get update


  • sudo − The sudo command is used to ensure that the command runs with root access.

  • update − The update option is used ensure that all packages are updated on the Linux system.

Return Value




When we run the above command, we will get the following result −

This command will connect to the internet and download the latest system packages for Ubuntu.


Step 3 − The next step is to install the necessary certificates that will be required to work with the Docker site later on to download the necessary Docker packages. It can be done with the following command.

Step 4 − The next step is to add the new GPG key. This key is required to ensure that all data is encrypted when downloading the necessary packages for Docker.

The following command will download the key with the ID 58118E89F3A912897C070ADBF76221572C52609D from the keyserver hkp:// and adds it to the adv keychain. Please note that this particular key is required to download the necessary Docker packages.

Step 5 − Next, depending on the version of Ubuntu you have, you will need to add the relevant site to the docker.list for the apt package manager, so that it will be able to detect the Docker packages from the Docker site and download them accordingly.

  • Precise 12.04 (LTS) ─ deb main

  • Trusty 14.04 (LTS) ─ deb ubuntu-trusty main

  • Wily 15.10 ─ deb ubuntu-wily main

  • Xenial 16.04 (LTS) - ubuntu-xenial main

Since our OS is Ubuntu 14.04, we will use the Repository name as “deb main”.

And then, we will need to add this repository to the docker.list as mentioned above.

Step 6 − Next, we issue the apt-get update command to update the packages on the Ubuntu system.

Step 7 − If you want to verify that the package manager is pointing to the right repository, you can do it by issuing the apt-cache command.

In the output, you will get the link to

Step 8 − Issue the apt-get update command to ensure all the packages on the local system are up to date.

Step 9 − For Ubuntu Trusty, Wily, and Xenial, we have to install the linux-image-extra-* kernel packages, which allows one to use the aufs storage driver. This driver is used by the newer versions of Docker.

It can be done by using the following command.

Step 10 − The final step is to install Docker and we can do this with the following command −

Here, apt-get uses the install option to download the Docker-engine image from the Docker website and get Docker installed.

The Docker-engine is the official package from the Docker Corporation for Ubuntu-based systems.

In the next section, we will see how to check for the version of Docker that was installed.

Docker Version

To see the version of Docker running, you can issue the following command −



  • version − It is used to ensure the Docker command returns the Docker version installed.

Return Value

The output will provide the various details of the Docker version installed on the system.



When we run the above program, we will get the following result −

Docker Info

To see more information on the Docker running on the system, you can issue the following command −


Oracle linux 7 install docker free


  • info − It is used to ensure that the Docker command returns the detailed information on the Docker service installed.

Return Value

The output will provide the various details of the Docker installed on the system such as −

  • Number of containers
  • Number of images
  • The storage driver used by Docker
  • The root directory used by Docker
  • The execution driver used by Docker



When we run the above command, we will get the following result −

Docker for Windows

Docker has out-of-the-box support for Windows, but you need to have the following configuration in order to install Docker for Windows.

Oracle linux 7 install docker software

System Requirements

Oracle Linux 7 Install Docker Compose

Windows OSWindows 10 64 bit
Memory2 GB RAM (recommended)

You can download Docker for Windows from −

Docker ToolBox

Docker ToolBox has been designed for older versions of Windows, such as Windows 8.1 and Windows 7. You need to have the following configuration in order to install Docker for Windows.

System Requirements

Windows OSWindows 7 , 8, 8.1
Memory2 GB RAM (recommended)
VirtualizationThis should be enabled.
Oracle Linux 7 Install Docker

You can download Docker ToolBox from −

Oracle Linux 7 Install Docker Tutorial

If you search in Docker Hub for Oracle Enterprise Edition, you will find there is already one at the following location: However, it has the following issues:

  • It is version 12c
  • It already contains a default database.
  • It is configured as multi-tenant with a single pluggable database.
  • It doesn't include advanced features: partitioning, data mining, database vault, label security, real application testing, and OLAP.
  • You can't customize it with different languages and character sets, RAC, data warehouse, etc.

You can create a custom Oracle instance in Docker Windows but only version 12c and newer, as detailed in this article: Install Oracle 12c in a Linux 7 container running on Docker Windows. However, many shops are still using Oracle 11g even when there is no support for it, and you may need a test instance for you migration planning and testing. Fortunately, you can create your own instance using Docker Linux, which is described in the steps below and in the prerequisites:

  1. Download the required media from Oracle. It is no longer provided in the link Oracle 11gR2 without you paying for support, but search for the file names '' and '' and you may have luck finding them. Place the files in a folder named '/temp'.
  2. Pull the latest Oracle Linux 7 image with the Docker command 'docker pull oraclelinux:7.8'. You can view the available versions in the link:, but you can't use a version greater than 7.
  3. You can't change the swap space in the Docker container, so you need to change it in the host. By default on Ubuntu it is set to 2GB, but Oracle requires it to be equal to the amount of RAM when you have between 2 and 16 GB of it; because I have 8 GB I need to run the following Linux commands as root (sudo su): 'swapoff /swapfile; dd if=/dev/zero of=/swapfile bs=1M count=8000; mkswap /swapfile; chown root:root /swapfile; chmod 600 /swapfile; swapon /swapfile; swapon -s;'
  4. You can't change the socket receive buffer default and maximum size (bytes) kernel parameters in the Docker container, so you need to change them in the host. Edit the file '/etc/sysctl.d/99-sysctl.conf' and add 'net.core.rmem_default=262144' (256 KB) and 'net.core.rmem_max=4194304' (4 MB). Don't forget to run '/sbin/sysctl -p' at the end to apply them. The default values in Ubuntu are 87380 for rmem_default (85 KB) and 212992 for rmem_max (208 KB).
  5. Get the host runlevel with the Linux command 'utmpdump /var/run/utmp'. This will be cloned into the container to fake a runlevel, in my case the output is: [2] [00000] [~~ ] [reboot ] [~ ] [5.4.0-54-generic ] [ ] [2020-11-29T22:54:41,607539+00:00] [1] [00053] [~~ ] [runlevel] [~ ] [5.4.0-54-generic ] [ ] [2020-11-29T22:54:51,237021+00:00] [7] [01506] [ ] [pabechevb] [:0 ] [:0 ] [ ] [2020-11-29T22:54:52,402714+00:00]
  6. Start the Docker container with the Docker command 'docker run --name OracleTest --privileged --network='host' -d -it -v /temp:/tmp --sysctl kernel.sem='250 32000 100 128' oraclelinux:7.8'. We specify 'privileged' because we need to change some kernel parameters, 'network=host' to make the container pick the values for rmem_default and rmem_max from the host, '-d' to have the container running forever, '-it' to keep STDIN open for interactive processes (shell), '-v' to mount the host /temp folder in the container /tmp location, 'sysctl kernel.sem=250 32000 100 128' to specify the semaphore values (semmsl: max semaphores per array, semmns: max semaphores system wide, semopm: max ops per semop call, and semmni: max number of arrays; in contrast in Ubuntu these default values are 32000 1024000000 500 32000), and 'oraclelinux:7.8' as the base Linux image to use.
  7. Login to the running container with the Docker command 'docker exec -it OracleTest /bin/bash'. If the container isn't running (i.e. after a host reboot) use the Docker command 'docker start -a -i OracleTest' instead.
  8. Fake the runlevel in the container with the Linux commands 'echo $'[2] [00000] [~~ ] [reboot ] [~ ] [5.4.0-52-generic ] [ ] [2020-10-31T20:52:37,609394+00:00]n[1] [00053] [~~ ] [runlevel] [~ ] [5.4.0-52-generic ] [ ] [2020-10-31T20:52:47,776498+00:00]n[7] [01543] [ ] [pabechevb] [:0 ] [:0 ] [ ] [2020-10-31T20:52:49,653875+00:00]' utmpdump -r > /var/run/utmp'.
  9. Change the container OS kernel parameters by editing sysctl.conf with the Linux command 'vi /etc/sysctl.d/99-sysctl.conf' and adding the lines: 'kernel.shmmax=536870912', 'kernel.shmall=2097152', 'net.ipv4.ip_local_port_range=9000 65500', 'fs.aio-max-nr=1048576', 'net.core.wmem_default=262144' and 'net.core.wmem_max=1048586'. By default their corresponding values are in order: 18446744073692774399, 18446744073692774399, 32768 60999, 65536, 212992 and 212992. Once the file has been saved, run the Linux command '/sbin/sysctl -p'.
  10. Install the required packages with the Linux command 'yum install -y compat-libstdc++-33 elfutils-libelf-devel gcc gcc-c++ glibc.i686 ksh libaio libaio-devel libstdc++ make sysstat unixODBC unixODBC-devel unzip'.
  11. Create the folder to uncompress files with the Linux command 'mkdir -p /tmp/', then uncompress the Oracle installer files with the Linux commands 'unzip /tmp/ -d /tmp/' and 'unzip /tmp/ -d /tmp/'. Remember /tmp contains the Oracle installer files since we placed them at the /temp folder in the host.
  12. Add the Oracle groups and user with the Linux commands 'groupadd oinstall; groupadd dba; groupadd oper; useradd -u 1000 -g oinstall -G dba,oper oracle;'.
  13. Create the install folder with appropriate permissions with the Linux commands 'mkdir -p /u01/app/; chown -R oracle:dba /u01/app/; chmod -R 775 /u01/app/;'.
  14. Create the Oracle installer file with the Linux command 'vi /etc/oraInst.loc', then add the lines 'inventory_loc=/u01/app/oraInventory' and 'inst_group=oinstall'.
  15. Switch to the 'oracle' user with the Linux command 'su oracle' since we can't install Oracle Database as 'root'.
  16. Define variables for the installation with the Linux commands 'ORA_INVENTORY=/u01/app/oraInventory; ORACLE_BASE=/u01/app/oracle; ORACLE_HOME=$ORACLE_BASE/product/;'.

Now you can execute the installer with the Linux command below:

You will see the following output:

The file '/u01/app/oraInventory/logs/installActions2020-11-29_11-54-10PM.log' will contain the following errors which can safely be ignored since we properly configured the system:

You can verify there were no errors with the Linux command 'cat /u01/app/oraInventory/logs/installActions2020-11-29_11-54-10PM.log grep error'. The installer tells you you must run the following script as 'root':

Oracle Linux 7 Install Docker Windows 10


Oracle Linux 7 Install Docker Manual

After it has been run, another log file is created:


The output in this file indicates some variables were set and the file /etc/oratab has been created.