X

News, tips, partners, and perspectives for Oracle’s virtualization offerings

Install Docker on Oracle Linux 7

Honglin Su
Sr. Director of Product Management

Recently a new Docker release 17.03.1.ce was announced for Oracle Linux 7. 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 ol7_latest, ol7_uekr4 and ol7_addons enabled.

# cd /etc/yum.repos.d/
# wget http://yum.oracle.com/public-yum-ol7.repo
# vi public-yum-ol7.repo

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

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

Next you simply use yum install to start the installation.

# yum install docker-engine
Loaded plugins: langpacks, ulninfo
Resolving Dependencies
--> Running transaction check
---> Package docker-engine.x86_64 0:17.03.1.ce-3.0.1.el7 will be installed
--> Processing Dependency: docker-engine-selinux >= 17.03.1.ce-3.0.1.el7 for package: docker-engine-17.03.1.ce-3.0.1.el7.x86_64
--> Running transaction check
---> Package docker-engine-selinux.noarch 0:17.03.1.ce-3.0.1.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

========================================================================================================================
 Package                            Arch                Version                           Repository               Size
========================================================================================================================
Installing:
 docker-engine                      x86_64              17.03.1.ce-3.0.1.el7              ol7_addons               19 M
Installing for dependencies:
 docker-engine-selinux              noarch              17.03.1.ce-3.0.1.el7              ol7_addons               28 k

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

Total download size: 19 M
Installed size: 65 M
Is this ok [y/d/N]: y
Downloading packages:
(1/2): docker-engine-selinux-17.03.1.ce-3.0.1.el7.noarch.rpm                                     |  28 kB  00:00:00     
(2/2): docker-engine-17.03.1.ce-3.0.1.el7.x86_64.rpm                                             |  19 MB  00:00:48     
------------------------------------------------------------------------------------------------------------------------
Total                                                                                   397 kB/s |  19 MB  00:00:48     
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : docker-engine-selinux-17.03.1.ce-3.0.1.el7.noarch                                                    1/2 
libsemanage.semanage_direct_install_info: Overriding docker module at lower priority 100 with module at priority 400.
  Installing : docker-engine-17.03.1.ce-3.0.1.el7.x86_64                                                            2/2 
  Verifying  : docker-engine-selinux-17.03.1.ce-3.0.1.el7.noarch                                                    1/2 
  Verifying  : docker-engine-17.03.1.ce-3.0.1.el7.x86_64                                                            2/2 

Installed:
  docker-engine.x86_64 0:17.03.1.ce-3.0.1.el7                                                                           

Dependency Installed:
  docker-engine-selinux.noarch 0:17.03.1.ce-3.0.1.el7                                                                   

Complete!
Once the installation is completed, you start the docker service.
# systemctl start docker
# systemctl enable docker
Created symlink from /etc/systemd/system/multi-user.target.wants/docker.service to /usr/lib/systemd/system/docker.service.

# systemctl status docker
● docker.service - Docker Application Container Engine
   Loaded: loaded (/usr/lib/systemd/system/docker.service; enabled; vendor preset: disabled)
  Drop-In: /etc/systemd/system/docker.service.d
           └─docker-sysconfig.conf
   Active: active (running) since Fri 2017-07-14 21:53:58 PDT; 3min 18s ago
     Docs: https://docs.docker.com
 Main PID: 13813 (dockerd)
   CGroup: /system.slice/docker.service
           ├─13813 /usr/bin/dockerd --selinux-enabled
           └─13818 docker-containerd -l unix:///var/run/docker/libcontainerd/docker-containerd.sock --metrics-interva...

Then you log into Oracle Container Registry, trusted source of Oracle software as Docker containers, to pull the appropriate Docker containers.

# docker login container-registry.oracle.com
Username: honglin.su@oracle.com
Password: 
Login Succeeded

# docker pull container-registry.oracle.com/os/oraclelinux:6.9
6.9: Pulling from os/oraclelinux
88710002ea6c: Pull complete 
Digest: sha256:9ee6b162062040c59f6bdc7fd47a9c55f08695c898d517b99bb6d48a0ed9ccf2
Status: Downloaded newer image for container-registry.oracle.com/os/oraclelinux:6.9

# docker pull container-registry.oracle.com/java/serverjre
Using default tag: latest
latest: Pulling from java/serverjre
78a05301de27: Pull complete 
1bd2d038d806: Pull complete 
Digest: sha256:cd18dd865cfd0a3b95732eee6e528ff86a96157221a47af48b388b316b1d4b4b
Status: Downloaded newer image for container-registry.oracle.com/java/serverjre:latest

# docker images
REPOSITORY                                     TAG                 IMAGE ID            CREATED             SIZE
container-registry.oracle.com/os/oraclelinux   6.9                 7a4a8c404142        3 weeks ago         171 MB
container-registry.oracle.com/java/serverjre   latest              289ea39a2a2c        6 weeks ago         377 MB

Now you have your Docker containers environment ready. For more details how to use Oracle Linux as your development platform, please visit Oracle Linux Documentation.

Join the discussion

Comments ( 15 )
  • Ganesh Friday, February 9, 2018
    Can you share details for installing docker-compose
  • Darshan Thursday, April 5, 2018
    Tried the above steps to install docker in Oracle Linux 7.4. Even after enabling the above mentioned packages in public-yum-ol7.repo, yum install docker-engine says No package docker-engine available.
  • Karthi Monday, May 7, 2018
    there is NO docker in these REPOs
  • Simon Monday, May 7, 2018
    Hi Karthi,

    docker-engine RPM is available under "ol7_addons" channel:

    http://yum.oracle.com/repo/OracleLinux/OL7/addons/x86_64/getPackage/docker-engine-17.06.2.ol-1.0.1.el7.x86_64.rpm

    That said, you can also find updated release under "ol7_preview" channel:

    http://yum.oracle.com/repo/OracleLinux/OL7/preview/x86_64/index.html

    Please, consider that "ol7_preview" is for development purposes only. Oracle suggests these not be used in production.

    Simon
  • siyu liu Friday, June 8, 2018
    I have tried the above steps and it works. Not sure if Darshan and Karthi used internal host as I did to see the "No package docker-engine available". If in that case, you would need some other walk around.
  • Ashok Kumar Thursday, September 20, 2018
    If yum report "No package docker-engine available."
    then follow below steps which worked for me.
    1. Update "enabled=1" under ol7_addons in /etc/yum.repos.d/public-yum-ol7.repo
    2. yum install docker-engine
  • Greg King Wednesday, October 17, 2018
    As usual... a well written and helpful blog Honglin.
  • siva pokuri Wednesday, October 17, 2018
    Thanks Ashok It worked for me.
  • KOLBER Sunday, November 11, 2018
    Is this Docker CE or EE ?
  • Honglin Su Monday, November 12, 2018
    Based on Community Edition.
  • Alex Sultanov Wednesday, January 2, 2019
    I keep getting "repository does not exist or may require 'docker login'" despite logging in with my oracle login:

    root@bla oracle]# docker login container-registry.oracle.com
    Username (alex.sultanov@oracle.com):
    Password:
    Login Succeeded
    [root@bla oracle]# docker pull container-registry.oracle.com/os/oraclelinux:6.9
    Trying to pull repository container-registry.oracle.com/os/oraclelinux ...
    pull access denied for container-registry.oracle.com/os/oraclelinux, repository does not exist or may require 'docker login'

    Any idea why?
  • Alex Sultanov Wednesday, January 2, 2019
    Keep getting pull error despite successsful login:

    root@bla oracle]# docker login container-registry.oracle.com
    Username (alex.sultanov@oracle.com): alex.sultanov@oracle.com
    Password:
    Login Succeeded
    [root@bla oracle]# docker pull container-registry.oracle.com/os/oraclelinux:latest
    Trying to pull repository container-registry.oracle.com/os/oraclelinux ...
    pull access denied for container-registry.oracle.com/os/oraclelinux, repository does not exist or may require 'docker login'

    Any idea how to fix it?
  • Honglin Su Saturday, January 5, 2019
    You need to login into the Oracle Container Registry and accept the license terms. Use your browser, sign in on https://container-registry.oracle.com
  • matjung Thursday, March 26, 2020
    cat oracle-release
    Oracle Linux Server release 8.1
    Did anyone write instructions for Oracle 8 and how to get docker with yum?
  • Honglin Su Monday, March 30, 2020
Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.