Wednesday, November 25, 2015

Run Docker on Oracle Linux 6

Docker on Oracle Linux 6 and proxy configuration

The docker documentation only explains how to configure it on Linux 7 (using systemd). This blog describes how to configure it on Oracle Linux 6 (using UEK)

Install docker using yum. For this, you need to create a new yum repository file (in /etc/yum.repos.d) with the following content: 
[dockerrepo]
name=Docker Repository
baseurl=https://yum.dockerproject.org/repo/main/oraclelinux/6
enabled=1
gpgcheck=1
gpgkey=https://yum.dockerproject.org/gpg
Install docker with:
yum install docker-engine
To start docker, run 
service docker start
Configuration of the docker daemon is in /etc/sysconfig/docker. If sitting behind a proxy server and you want to download docker images from the "outside world", you need to configure http_proxy for the daemon:
In /etc/sysconfig/docker add the following line: 
export http_proxy="http://<proxy-server>:<port>"
 The command "export" is required for this setting to work! After modifying /etc/sysconfig/docker, the daemon needs to be restarted: 
service docker restart
 Now you can download the docker basic sample hello-world:
docker run hello-world
 or 
docker pull hello-world
 Now docker should work on Oracle Linux 6.