Install Docker in Linux

Source: Internet
Author: User

1. Install docker on CentOS 6.4

Docker currently only supports Ubuntu, so it is troublesome to install Docker on CentOS (Issue #172 ).

According to the official docker documentation, at least 3.8 of Linux kernel is required, and CentOS 6.4 is the 2.6 kernel. Therefore, I have compiled and installed the latest kernel 3.11.6. After the restart, docker still fails to run, the final reason was found because the aufs module was not integrated during compilation. Aufs needs to be compiled with kernel, which is very troublesome.

However, this is not necessary. Some strong people have compiled the kernel with the aufs module. For details, see Installing docker. io on centos 6.4 (64-bit)

1.1 cancel selinux because it will interfere with the normal functions of lxc
sudo vim /etc/selinux/config SELINUX=disabledSELINUXTYPE=targeted
1.2 install Fedora EPEL
sudo yum install http://ftp.riken.jp/Linux/fedora/epel/6/x86_64/epel-release-6-8.noarch.rpm
1.3 Add the hop5 repo address
cd /etc/yum.repos.dsudo wget http://www.hop5.in/yum/el6/hop5.repo
1.4 install docker-io
sudo yum install docker-io

The 3.10 kernel with the aufs module and the docker-io package are automatically installed.

1.5 Add the cgroup File System /etc/fstabOnly in this way can docker work normally
sudo echo "none                    /sys/fs/cgroup          cgroup  defaults        0 0" >> /etc/fstab
1.6 modify the grub boot sequence
sudo vim /etc/grub.confdefault=0

Set default to the location of the newly installed kernel, usually 0

1.7 restart
sudo reboot
1.8 check whether the new kernel boot is successful

After the restart, check whether the new kernel is booted.

uname -r3.10.5-3.el6.x86_64

It indicates the operation is successful.

Check whether aufs exists.

grep aufs /proc/filesystems nodev   aufs

Description already exists

1.9 start the docker daemon process
sudo docker -d &

If you are in the company and the company accesses the Internet through proxy, you can tell the proxy server to docker and use the following command (refer to here ):

sudo HTTP_PROXY=http://xxx:port docker -d &
1.10 download ubuntu Image
sudo docker pull ubuntu
1.11 run hello world
sudo docker run ubuntu /bin/echo hello worldhello world

Installation successful !!

2. Install docker on Ubuntu

See official documentation for Ubuntu Linux

Dockerlite: lightweight Linux Virtualization

Detailed explanation of the entire process of building Gitlab CI for Docker

What is the difference between Docker and a normal Virtual Machine?

Docker will change everything

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.