Docker official website: https://docker.com/
Chinese translation Very good study address: http://dockerpool.com/static/books/docker_practice/index.html
Before we learn a new technology, what should we do as long as it is? Why use? How to use?
For Docker, we still follow this step to learn:
1. What is Docker?
2. Why use Docker?
3. How to use Docker?
What is Docker? (citation: http://dockerpool.com/static/books/docker_practice/introduction/what.html)
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.
The image below compares the differences between Docker and traditional virtualization, where the container is virtualized at the operating system level, directly reusing the local host's operating system, while the traditional approach is implemented at the hardware level.
Why use Docker? (citation: http://dockerpool.com/static/books/docker_practice/introduction/why.html)
As an emerging virtualization approach, Docker has a number of advantages over traditional virtualization approaches.
First, the launch of the Docker container can be implemented in seconds, which is much faster than the traditional virtual machine approach. Second, Docker is highly utilized for system resources and can run thousands of Docker containers simultaneously on a single host.
In addition to running applications, the container does not consume any additional system resources, which makes the performance of the application very high and the overhead of the system as small as possible. Traditional virtual machines run 10 different applications with 10 virtual machines, and Docker only needs to start 10 isolated applications.
Specifically, Docker has a big advantage in the following areas.
Faster delivery and deployment
for development and operations (DEVOP) personnel, the most desirable is to create or configure one at a time, which can be run anywhere.
Developers can use a standard image to build a set of development containers that, when developed, can be used directly by the OPS to deploy the code. Docker can quickly create containers, quickly iterate applications, and make the entire process visible, making it easier for other members of the team to understand how the application was created and worked. Docker containers are very light and fast! The start time of the container is second-level, which saves the time of development, testing and deployment greatly.
More efficient Virtualization
The Docker container runs without additional hypervisor support, which is a kernel-level virtualization that enables higher performance and efficiency.
Easier migrations and extensions
Docker containers can run on virtually any platform, including physical machines, virtual machines, public clouds, private clouds, personal computers, servers, and more. This compatibility allows the user to migrate an application directly from one platform to another.
More Simple management
With Docker, you can replace a lot of previous updates with just a little bit of modification. All modifications are distributed and updated incrementally, enabling automation and efficient management.
Compare traditional virtual machine summaries
features |
Container |
Virtual Machines |
Start |
Second level |
Minute level |
Hard disk use |
is generally MB |
Typically GB |
Performance |
Close to native |
Weaker than |
System Support Volume |
Stand-alone support for thousands of containers |
Dozens of general |
How does Docker work? This is a very big question, and it's about what we're going to learn in the next week, two weeks or one months. So we're going to go one step at a ...
Docker Installation:
Docker supports CENTOS6 and later versions, and the author takes Centos6.5 as an example for installation learning. Other versions can refer to https://docs.docker.com/engine/installation/centos/
The official document says Docker requires 64 Centos, and the kernel is above 3.10.
1. Check the CentOS version
[[email protected] /]# uname -r
2.6.32-431.el6.x86_64
Version is less than 3.10 and requires an upgrade kernel. As explained here, the small series is not upgraded or can be installed Docker, features can also be used ...
However, we still need to upgrade the kernel according to the official documents ...
Pre-upgrade system Image:CentOS 6.5 64-bit
kernel version:2.6.32-431.el6.x86_64
To upgrade the kernel steps:
1,rpm--import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org ( Import public KEY)
2,RPM-UVH http://www.elrepo.org/elrepo-release-6-6.el6.elrepo.noarch.rpm ( Install Elrepo to the kernel 2.6.32 in CentOS )
3.Yum--enablerepo=elrepo-kernel install kernel-lt-y ( installation Kernel-lt (l Ong term Support version )
Note: Since this source is abroad, it is slower to use the Elrepo source directly using Yum, so it is recommended to use RPM to install KERNEL-LT, access
http://elrepo.org/linux/kernel/el6/x86_64/RPMS/
To download the corresponding RPM package, use the RPM method to install:
RPM-IVH kernel-lt-3.10.93-1.el6.elrepo.x86_64.rpm
In addition, the introduction of KERNEL-LT can be directly Access Http://elrepo.org/tiki/kernel-lt
4. edit the grub.conf file and modify the Grub boot order
vim/etc/grub.conf
confirm the location of the new kernel installed, adjust the default value to the new kernel's order, such as the upgrade case in the newly installed kernel location is 0, so the default is modified to 0, save exit, reboot restart the server.
5. Check the kernel after rebooting the system
[Email protected]/]# uname-r
3.10.93-1.el6.elrepo.x86_64
6. Test after kernel upgrade is complete
After the upgrade is complete, you can install Docker for use observation:
Yum Install-y Docker-io
Service Docker start
Docker Pull Centos:centos 7
Docker run-t-I centos:centos 7/bin/bash
Not to be continued ...
Docker Basic Learning (i)