Fun with docker

Source: Internet
Author: User

First talk about gambling

(Group words, gambling,...), time, gambling every day!

What is gambling? The benevolent sees benevolence, the wise man must have another opinion, keep silence, and keep opinions;

-- Change the thinking mode. ruiy enables gambling to win in the "thinking "!!!;

The trend is like a horse. If you are chasing behind a horse, you will never be able to catch up. You can only ride on a horse to get as fast as a horse. This is called success immediately;

If it exists, you must always think about it;

The gentleman will do two things (report if you have any enemies, or it will be difficult to get angry and hurt yourself !, Ruiy is eager to follow suit;

All leading the times are "scammers ":

Those who say that others are scammers cannot achieve success, and the quality of life is worse than one day! Those so-called "scammers" have become the symbols of the times!

(Police,) "Xianzhi xianjue operator; Houzhi Xianzhi followers; unconsciously consumers! It is better to cross the river by boat when building a ship.
Trend, which cannot be blocked;
Make a decision and be smart!

There are countless readers who are not as good as famous teachers,
It's better to show directions to successful people!
What should you do in the face of challenges?
Please remember, do not wait until tomorrow, tomorrow is too far away, today will act.

The words are too bad. Ha, okay. Let's stop it. It's time to talk about things. Don't play with things, don't learn about it, don't think about things, don't ....!

Play with ruiy on a docker simple VM:

Https://docs.docker.com/installation/centos/ [docker offical Doc]

// By ruiy

// Rui believes that in this year, the technology replacement TM is very fast. The simpler the technology is, the lighter it is, and the more Sb it is. The key is that players should not be made sb !;

(Note: who should not start spark when playing big data ?, Who does not play KVM for virtualization, but can't mix docker ?)

Docker VM (summary, you know) is a simple difference;

The official website is like this:

Docker is an open platform for developers and sysadmins to build, ship, and run distributed applications ....

Here, ruiy also wants to be arrogant. Don't let a text or punctuation point off. (generally, do not let anything go, because every character has its own necessity, is it necessary to exist ?)

A sentence can often be ......;

The main difference between docker and Vm lies in the performance advantages (one VM runs a guest OS for each virtual Vm, instead of docker. Each physical machine can run thousands of docker, how many VMS can be virtualized ?, Docker only isolates the process and shares the OS with the scaled-down host. If it does not parse anything else, ruiy will be at this level. For deepin, please go to offical station read offical document, thanks !!!), Some of them are excerpted from the Internet, and some water is added to them;

After reading this sentence, I still don't understand what it is. I will explain it slowly. However, to put it short, imagine him as an ultra-lightweight virtual machine that is implemented in a novel way, and the approximate effect is also correct. However, there is a huge difference between the implementation principle and the application, and the professional name is application container ).

Why use a container?

What does an application container look like? A good application container looks like a virtual machine with a specific set of applications installed. For example, if I want to use MySQL, I will find a container with MySQL installed and run it. Then I can use MySQL.

So I just need to install MySQL directly. Why do I need such a strange concept as a container? In this case, if you want to install MySQL, you may need to install a bunch of dependent libraries and set them based on your operating system platform and version, sometimes a bunch of inexplicable errors are reported from source code compilation, which is not so easy to install. In addition, if your machine crashes, everything will be re-installed, and configuration may need to be re-configured. But with the container, you have a virtual machine that can run. As long as you can run the container, MySQL configuration will be complete throughout the province. And once you want to replace the machine, simply put the container up and put it on another machine. The hardware, operating system, and running environment do not need to be considered.

A major purpose of the company is to ensure that the offline development environment, testing environment and online production environment are consistent. In Baidu that year, we often encountered such a problem. Developers have done a good job in testing and generally give a bunch of code and a launch ticket introducing the launch steps. The result code cannot run on the testing machine, and the development will run around to check the problem. After a while, the configuration file is forgotten to be submitted, and the online command is wrong. I found a bug and wrote it on the launch ticket. Similar things will happen again when it goes online. It turns out that the version of your software is different from that on my machine ...... In Amazon, one developer directly holds the three positions and has a set of automatic deployment mechanisms, so there will be fewer problems. However, when I went online, I was shocked.

If the container is used, the development will be directly developed in the container. During the test, the entire container will be tested. After the test, the changes will be changed to the container and then released. Through containers, the entire development, testing, and production environment can be highly consistent.

In addition, containers have a certain degree of isolation like VMS. The data and memory space between containers are isolated from each other to ensure certain security.

Why don't I use a VM?

So since the container and Vm are so similar, why don't we just use the VM to create a whole container concept? Docker containers have the following advantages over VMS:

  • The startup speed is fast. containers can be started within one second, while VMS usually take longer.
  • High resource utilization. A common PC can run thousands of containers. You can run thousands of VMS.
  • The performance overhead is small. VM usually requires additional CPU and memory to complete OS functions. This part occupies additional resources.

Why is there a huge gap in performance between similar functions? In fact, this is related to their design philosophy. The VM design is as follows:

 

The hypervisor of the VM needs to virtualize the hardware and carry its own operating system, which naturally overhead the startup speed, resource utilization, and performance. The docker design diagram is as follows:

 

Docker has almost nothing to do With virtualization, and the host Host OS is reused directly. At the docker engine layer, the scheduling and isolation weight is reduced to several levels. Docker containers use lxc to manage namespaces for permission control and isolation, cgroups for resource configuration, and aufs for further improving file system resource utilization.

Among them, aufs is a very interesting thing and a kind of unionfs. His idea is similar to that of git. He can regard changes to the file system as a commit stack. In this way, multiple containers can share their file system layers. Each container is under the shared file system level, and the above is the level of their respective changes to the file system, this greatly saves storage requirements and accelerates the startup of containers.

<2. docker for centos intall use epel Yum repo>

Https://fedoraproject.org/wiki/EPEL [epel introduce]

Note that due to the current docker limitations, docker is able to run only on64 bitArchitecture

We would like to remind you that 32 bits/64 bits are excellent (I will not talk about it any more. Anyone who has played MongoDB knows that MongoDB has limits on The filesize of 32bit arch architecture machines, <= 2G, but the 64-bit size is not limited. As long as your disk permits, docker does not support 32bit. So far, I will not talk about anything else, you know !)

I also spoke nonsense, listening to a letter, disdain, please enter the left eye, right eye out, or Please ...... wash and sleep ,......;

First, let's get your ears. (We All Know that docker is based on lxc. For details, see the more specific ones ....)

 

 

 

The next-generation lightweight virtualization technology of docker.

(Remember to use epel repo Yum to install docker-io)

01, docker engine composition, Version Information

Daemon server process manaes all containers, client (remot control daemons), docker version [[email protected]/] # docker version;

02, searching Images

Search for image using the command line

Doocker search <string, imagename>, container image are available on the docker hub register, a cloud-based collection of application;

03. Download docker container Images

Docker pull

Images in the docker hub register the name you specify is constructed as <username>/<repository>

04, output string;

  

05,

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.