First: A simple introduction to Docker (i)

Source: Internet
Author: User

This article directory

    1. It's written in the front.
    2. Docker Concept Introduction
    3. The concept of mirroring, the concept of containers
    4. Introduction to Docker Installation

It's written in the front.

Hello everyone, first of all say sorry, I swim, I am doing system development, the use of language is C # and Java these two categories, and then a lot of programming language is really no energy to learn. Docker's application skills are learning intermittently and not proficient. Is able to say I am familiar with it, I can use it. I can understand it simply. All next if there is a wrong place, you can leave a message to me, if I see, will be verified and corrected.

I have sketched out a learning master plan, the ultimate goal is to learn big data development, distributed architecture, such. I don't know if I'm in the right direction, and I'm going to lean on this next course.

Finally, thank you.

Docker Concept Introduction

I personally understand the Docker technology, is a running container, how to understand? The so-called operating container is all necessary for a system or program, such as when you run a jar or war, what do we need to say "Hello world"? Need is JVM, is JRE, that time we just jvm,jre enough memory, CPU, network card and so on, our code can run in any place. At this point, one might ask, what is the difference between it and a virtual machine? It is true that many people will compare VMs with Docker, so the virtual machine needs an OS (operating system) and we can do anything on the virtual operating system. But attention, if I just want to run a program, it is not very wasteful to install a virtual machine, and the virtual machine is also very resource-consuming physical machine.

So, virtual machine it is such as "OS", "Hyper", "Guest os", "Bin/libs" and "apps".

And, Docker, it is the "OS", "Docker Engine", "Bin/libs", "apps".

So by comparison, you can clearly see the difference between the two Docker engine can be isolated from the system while maintaining communication.

The concept of mirroring, the concept of containers

Through the above introduction to the Docker concept, we learned that Docker daemon can be very good to the internal operation of the container and the external execution of the container isolation, non-interference. So how do we write the first word Hello world? We need to understand two concepts, mirroring (image), container (container).

I understand that the container = mirror + writable area. What do you mean? To be blunt, a container is the place where the mirror is run, which provides the container with the necessary readable and writable areas. Just like, the baby in the mother belly, the infant is like image, and the mother's belly is container, for the small baby to provide the space for activities and the necessary nutrients.

So, the image is just some read-only file, and the container is read-only file + writable area

Introduction to Docker Installation

To put it simply, it's better to actually do it. In the process can be deeply realized, everything has a process, do not ignore the concept and principle, we can first imitate, first use, and then turn to see the principle. It doesn't matter if you get it wrong, because if you know the principle at first, Docker is what you create. Haha, so while learning to adjust the principle of understanding.

Well, it's important and important to confirm the environment before we start. First of all, do not use Mac system, do not use Mac system, do not use Mac system, important things say three times, because mac it is not liunx kernel . Many of the commands on your Mac are encapsulated, and you can't know some of the information inside. It will give you some inexplicable error hints.

Second, it's not recommended to use Windows, as for why, I'm not sure, but I'm not used to using Docker under Windows. Very variable twist very chicken, interested can try.

Finally, the recommended Ubuntu or CentOS, very useful. I am using Ubuntu, although I do not have all the commands and parameters, but I use it, still feel very convenient. It's good, sometimes it's better than Windows.

Of course, the above are my personal opinion, we can choose the system environment according to preferences, not to do later, the article appears in the system are Ubuntu. How to install the operating system environment I won't talk about it here.

Go to the system, on the desktop, right click, select "Open Terminal"

View the Docker version

  

Of course, if you do not have Docker installed, the version number information will not appear,

Before the installation, I need to do one thing, because of political, historical reasons, hit the door country has a wall very strong, the Great Wall firewall, so when we get Docker, we need to set the next image acceleration.

Enter "sudo vim/etc/docker/daemon.json" in the command, if prompted

  

Don't be afraid to run "sudo apt install vim" and let's install this vim command.

Next, after running "sudo vim/etc/docker/daemon.json", open the Edit

We use NetEase's image to accelerate, save well, we can happily prepare to install Docker.

Use "sudo wget -qO- https://get.docker.com/| sh" to wait silently, prompting "sudo service Docker start" after successful installation Start the service.

Finally, we'll use the above view of the Docker version to see the next Docker version. You can do it.

There are many ways to install Docker, not difficult. People may be a little unfamiliar with the order, or that sentence, perseverance and habits.

The above is my simple summary, suitable for quick start or want to know the next Docker friends, I hope you can enjoy.

This kind of article will be updated occasionally, if, please indicate the source.

E-mail: wuyun151@163.com Wuyunlong.

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.