Docker is an open source project that was born in early 2013 and was originally an amateur project within the DotCloud company. It is based on Google's launch of the Go language implementation. The project later joined the Linux Foundation and complied with the Apache 2.0 protocol, and the project code was maintained on GitHub.
Docker has been widely watched and discussed since open source, so that DotCloud company later changed its name to Docker INC. Redhat has focused on supporting Docker;google in its RHEL6.5 and is also widely used in its PaaS products.
The goal of the Docker project is to implement a lightweight operating system virtualization solution. Docker is based on technologies such as Linux containers (LXC). On the basis of LXC, Docker has been further encapsulated, so that users do not need to care about the management of containers, making the operation easier. User-operated Docker containers are as simple as operating a fast, lightweight virtual machine.
Docker is an open-source application container engine that allows developers to package their applications and dependencies into a portable container, and then publish them to any popular Linux machine or virtualize them. Containers are completely sandbox-aware, with no interface (like IPhone apps) between them. There is little performance overhead and can be easily run in the machine and data center. Most importantly, they are not dependent on any language, framework or packaging system.
Notable features:
File system isolation: Each process container runs in a completely separate root file system.
Resource isolation: system resources, such as CPUs and memory, can be assigned to different containers, using Cgroup.
Network isolation: Each process container runs on its own network space, virtual interface, and IP address.
Logging: Docker collects and records the standard flow (Stdout/stderr/stdin) for each process container for real-time retrieval or bulk retrieval.
Change management: Changes to the container file system can be submitted to the new image and reused to create more containers. No need to use templates or manual configuration.
Interactive Shell:docker can assign a virtual terminal and associate it to the standard input of any container, such as running an interop shell once.
First, CentOS compiled installation Docker
1, upgrade the kernel to 4.3
Yum install-y make gcc gcc-c++ OpenSSL openssl--devel ncurses ncurses-devel bcwget http://mirrors.dwhd.org/Kernel/v4.x/l Inux-4.3.tar.xztar XF linux-4.3.tar.xz-c/usr/src/cd/usr/src/linux-4.3/cp/boot/config-' uname-r '. Configsh-c ' yes ' | Make Oldconfig ' # make Menuconfig # # #自定义需要编译的选项 # scripts/kconfig/mconf Kconfig # # #自定义需要编译的选项make-j ' awk '/processor/{ A++}end{print A} '/proc/cpuinfo ' bzimagemake-j ' awk '/processor/{a++}end{print A} '/proc/cpuinfo ' modulesmake-j ' awk '/p Rocessor/{a++}end{print A} '/proc/cpuinfo ' Modules_installmake install# make Mrproper # # #编译出错重新编译需要做清除处理sed-ri ' s/( default=). */\10/'/boot/grub/grub.confrebootuname-a
2. Turn off SELinux
Sed-ri ' s/^#? ((\s+)? SELINUX (TYPE)?. *)/#\1/; $a selinux=disabled\nselinuxtype=targeted '/etc/sysconfig/selinux/usr/sbin/setenforce 0
3. Compiling high-version git
Yum-y Remove gityum-y Install zlib-devel perl-cpan gettext curl-devel expat-devel gettext-devel openssl-develwget http:/ /mirrors.dwhd.org/git/git-2.6.3.tar.xztar XF git-2.6.3.tar.xz CD git-2.6.3./configure--prefix=/usr/localmake-j $ ( awk '/processor/{i++}end{print i} '/proc/cpuinfo && make install && CD. echo "Path=/usr/local/bin:\ $PATH" >/etc/profile.d/git.sh. /etc/profile.d/git.shwhich Git/usr/local/bin/gitgit--version
4, detect iptables version XZ version and PS command, iptables≥1.4,xz≥4.9
Which psiptables-vxz-v
5, Installation Cgroup
Yum install-y libcgroup libcgroup-devel libcgroup-pam
6. Install Go
wget Https://storage.googleapis.com/golang/go1.5.linux-amd64.tar.gztar XF go1.5.linux-amd64.tar.gz-c/usr/local/ echo "Export Goroot=/usr/local/goexport path=\ $PATH: \ $GOROOT/binexport gopath=/home/go" >/etc/profile.d/go.sh. /etc/profile.d/go.shwhich Go/usr/local/go/bin/gogo Version
Second, Yum installs Docker on the CENTOS7 system
centos7.x Installing Docker
RPM-UVH http://dl. Fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpmyum-y Install Docker-io # This is the only command that can be done. Service Docker start # starts Dockerchkconfig Docker on
# Join Boot up
Another type of:
Yum clean allcat >/etc/yum.repos.d/docker.repo <<-eof[dockerrepo]name=docker repositorybaseurl=https:// Yum.dockerproject.org/repo/main/centos/7enabled=1gpgcheck=1gpgkey=https://yum.dockerproject.org/gpgeofyum Makecacheyum install-y docker-enginesystemctl start docker.servicesystemctl enable Docker.service ln-s '/usr/lib/ Systemd/system/docker.service '/etc/systemd/system/multi-user.target.wants/docker.service ' systemctl status Docker.service Docker Run Hello-world
Ubuntu installation
1. Update the Ubuntu kernel
Use the following command line to update the kernel to 3.8.0-25
sudo apt-get install linux-image-3.8.0-25-genericsudo apt-get Install Linux-headers-3.8.0-25-generic
When you are done, restart your computer and check to see if the kernel has been successfully updated by the command "Uname-r".
2, Installation Lxc-docker
sudo apt-get install software-properties-common #增加 add-apt-repository command sudo apt-get install Python-software-properties sudo add-apt-repository ppa:dotcloud/lxc-docker #增加一个ppa源, such as: Ppa:user/ppa-namesudo Apt-get Update #更新系统sudo apt-get install Lxc-docker
Docker installation of Linux CentOS