First, because docker requires support for some Linux components and kernel features, make sure that the centos version is later than 6 and the kernel version is later than 2.6.32-431. You can upgrade centos6 to the latest version.
Sudo Yum upgrade
Then install cgroup
Sudo Yum install libcgroupservice cgconfig start # Start the croup service lssubsys-AM
If the installation is successful, the last command, lssubsys-Am, displays the mount points of all subsystems.
Install lxc using source code
Sudo Yum install GCC makewget http://sourceforge.net/projects/lxc/files/latest/download? Source = filestar-XF lxc-0.9.0.tar.gzcd Co., lxc-0.9.0./configure -- disable-capabilitiesmakesudo make installlxc-checkconfig
If the installation is successful, the last command lxc-checkconfig will successfully display the features that the kernel supports lxc.
Finally, install docker. Install docker on centos by directly downloading the bin package.
Cd ~ Wget https://get.docker.io/builds/Linux/x86_64/docker-latest.tgztar-XF docker-latest.tgzusr/local/bin/docker-d
In this way, the docker service is started, and there will be time to deploy a docker virtual container in the reverse direction.