Link to the original text: http://www.itbus.tech/detail.html?id=8733
Preparatory knowledge
Although we'll introduce a lot of concepts next, it's better to know what Docker is and why you use it in advance.
Let's assume that you are familiar with the following knowledge:
+ IP Address and Port
+ Virtual Machine
+ Editing configuration files
+ Basic Understanding of Code Dependence and Code Construction
+ Indicators of the use of computer resources, such as CPU usage, RAM usage, etc.
A brief explanation of containers
Mirrors are lightweight, independent, executable packages, and contain everything that software needs to run, including code, runtime environment, libraries, environment variables, configuration files, and so on.
The container is a running instance of a mirror -- that is, when the mirror is loaded into memory and actually executed. By default, containers and hosts are completely isolated and, at most, host files and ports are used only when they are configured.
Containers will run applications directly in the host's kernel, which will have better performance than virtual machines, because virtual machines can only indirectly use the virtual permissions of host resources through hypervisor s. Containers can obtain native resource access, each running in a separate process without additional memory.
Virtual Machine Diagram
Look at each OS layer. The operating system of the client runs on the virtual machine. This is resource centralization. As a result, disk mirroring and application state are all coupled with the host, including host settings, system installation dependencies, system security patches, and other small details that are easily overlooked.
Container schematic diagram
Containers share a kernel, and to create a container image, you only need the execution files of the program and the related dependencies, which do not need to be installed on the host. You can use docker ps to manage these processes, much like native processes using the ps operating system. Finally, it's important to note that containers already contain all the dependencies on program execution, and no configuration is required; therefore, a containerized application can be "runs anywhere" (run anywhere).
Set up
Before setting up, make sure you have secretly transferred the latest version of Docker. install
Note: This document requires no less than 1.13 versions.
If installed, try running docker run hello-world:
➜ ~ docker run hello-world
Unable to find image 'hello-world:latest' locally
latest: Pulling from library/hello-world
b04784fba78d: Pull complete
Digest: sha256:f3b3b28a45160805bb16542c9531888519430e9e6d6ffc09d72261b0d26ff74f
Status: Downloaded newer image for hello-world:latest
Hello from Docker!
This message shows that your installation appears to be working correctly.
To generate this message, Docker took the following steps:
1. The Docker client contacted the Docker daemon.
2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
3. The Docker daemon created a new container from that image which runs the
executable that produces the output you are currently reading.
4. The Docker daemon streamed that output to the Docker client, which sent it
to your terminal.
To try something more ambitious, you can run an Ubuntu container with:
$ docker run -it ubuntu bash
Share images, automate workflows, and more with a free Docker ID:
https://cloud.docker.com/
For more examples and ideas, visit:
https://docs.docker.com/engine/userguide/
To see if the version meets the requirements, use docker --version:
➜ ~ docker --version
Docker version 17.05.0-ce-rc1, build 2878a85
If your results are similar to mine, you can play with Docker happily.