Wednesday, 30 November 2016

Run Docker on Oracle Cloud Compute Service and OL 7.2

DEPRECATED - with the availability of the Unbreakable Enterprise Kernel Release 4 (4.1.12) image, the update steps are no longer necessary. Just yum install docker.

---8<-------------------------------------------------------------------------------------------------------

Installing Docker on Oracle Linux 7.x is easy, just to follow the official documentation. According to the documentation "Docker requires the use of the Unbreakable Enterprise Kernel Release 4 (4.1.12)". To get that running on the Oracle Public Cloud Compute Service, a few steps are neccesary.


Start with creating a new instance


Go with the latest OL 7.2. Notice, that some of the 6.x images are already running Unbreakable Enterprise Kernel (UEK) R4, but OL 7.2 is still running UEK R3, which is Linux Kernel 3.x.


Upload your SSH private key and create the image, then open the SSH port and and ssh to your machine. uname -r shows, that it is still on Kernel 3.8.13-something. Yum offers only a slight update for the kernel.


Anyways do a full yum update for the installation and afterwards reboot your instance.


The kernel is still UEK R3, but yum check-update now offers a UEKR4 kernel version 4.1.12, which is exact the minimum requirement for Docker 1.12. Pew! Do the yum update and reboot thing again.


After reboot just double check that the kernel is now 4.1.12. Now we are ready to go.


The rest is straight forward. The fastest way is not to follow Docker's guide for Oracle Linux, but use their guide for Red Hat Linux instead and use the script.

curl -fsSL https://get.docker.com/ | sh

That does the trick. And it nicely reminds you of adding your user to the docker group, so better do so.


Then just follow Docker's documentation and run

sudo systemctl enable docker.service

sudo systemctl start docker

sudo docker run hello-world

The last step should give you "Hello from Docker!", that's it.