Skip to content

Instantly share code, notes, and snippets.

@sholokhov
Last active September 6, 2016 16:01
Show Gist options
  • Save sholokhov/aeb2a53f3b41e142089bf04c5725fcf5 to your computer and use it in GitHub Desktop.
Save sholokhov/aeb2a53f3b41e142089bf04c5725fcf5 to your computer and use it in GitHub Desktop.
How to install docker on Red Hat Linux 6

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment