You need kernel version at least 2.6.32-431 or higher (check it with uname -r
command).
curl -O -sSL https://get.docker.com/rpm/1.7.1/centos-6/RPMS/x86_64/docker-engine-1.7.1-1.el6.x86_64.rpm
Then install package via yum:
yum localinstall --nogpgcheck docker-engine-1.7.1-1.el6.x86_64.rpm
Try to run it:
service docker start
Starting cgconfig service: [ OK ]
Starting docker: [ OK ]
If there are no errors during docker starting - my congratulations to you :) Thats all, just check it with
docker run hello-world
If run fails with message like this:
Starting cgconfig service: Error: cannot mount memory to /cgroup/memory: Invalid argument
/sbin/cgconfigparser; error loading /etc/cgconfig.conf: Cgroup mounting failed
Failed to parse /etc/cgconfig.conf or /etc/cgconfig.d [FAILED]
you need to fix your /etc/cgconfig.conf
file like this:
mount {
cpuacct = /cgroup/cpuacct;
# memory = /cgroup/memory;
devices = /cgroup/devices;
freezer = /cgroup/freezer;
net_cls = /cgroup/net_cls;
blkio = /cgroup/blkio;
cpuset = /cgroup/cpuset;
cpu = /cgroup/cpu;
}
It is also recommended to update your device-mapper-libs
to latest available version:
yum update device-mapper-libs
And then just restart docker service.
You can also try this:
sudo -i
echo "cgroup /sys/fs/cgroup cgroup defaults 0 0" >> /etc/fstab
mount /sys/fs/cgroup