Reprint please indicate the source:
https://blog.csdn.net/forezp/article/details/80098675
This article is from Fang Zhibong's blog
This series of tutorials is translated into the Docker document, document address: https://docs.docker.com/, for some reason, the official Docker document is usually not open, if not open, after installing Docker, you can pull the image of the Docker document to run locally. When you are done installing Docker, enter the command:
Docker run-it-d-P 4000:4000 docs/docker.github.io:latest
Open localhost:4000 on the browser to see the Docker documentation.
This series of tutorials was translated in April 2018, when the Docker version was the relevant concept of V18.03 Docker
Docker is a platform for developers and OPS to develop, publish, and run applications in containers. Using a Linux container to deploy applications is called containerized. The container is not a new concept, its advantage is that it is easy to publish an application.
Containerized becomes very popular because it has the following advantages: flexibility: Even the most complex applications can be containerized. Lightweight: The container maximizes the use and sharing of the host's kernel. Interchangeable: You can deploy updates and upgrade apps instantly. Convenient: You can build your app locally, deploy it to the container cloud, and run it anywhere. Expandable: You can increase and automatically distribute the number of containers. Stackable: You can stack services vertically and stack services on the fly.
Mirrors and Containers
The container is started by running a mirror. A mirror is an executable package that contains everything you need to run your application-code, runtime libraries, environment variables, and configuration files.
A container is a mirrored run-time instance that is a mirror that runs in memory (that is, a mirror has a state, or a user process). You can see a series of running containers by banging a Docker PS like a Linux environment. containers and virtual machines
A container is running locally on the Linux service and sharing the host's kernel with other containers. It runs in a separate process, and the container's memory footprint is smaller and lighter than other executable processes, such as virtual machines.
In contrast, a virtual machine (VM) runs a full "customer" operating system that accesses host resources through virtual hypervisor virtual machines. In general, virtual machines provide more environments than most applications require.
Prepare your Docker environment
Please see the official website for Docker installation.
CentOS Installation:
Yum-y Install Docker-io
Start:
Service Docker start
For more system installation please crossing net. test the Docker version to run the docker–version command and make sure that the Dokcer version you installed supports the change command:
Docker--version
Docker version 17.12.0-ce, build C97c6d6
Run the Docker info (Docker version no –) command to view more Docker installation information. 3.
Docker info
containers:0
running:0
paused:0
stopped:0
images:0
Server version:17.12.0-ce
Storage driver:overlay2
...
Test Docker installation SuccessRun a simple Docker image (Hello World) to test the Docker installation successfully.
Docker run Hello-world
unable to find image ' hello-world:latest ' locally
latest:pulling from library/ Hello-world
ca4f61b1923c:pull complete
digest:sha256: CA0EEB6FB05351DFC8759C20733C91DEF84CB8007AA89A5BF606BC8B315B9FC7
status:downloaded Newer image for Hello-world:latest
Hello from docker!
This message shows the your installation appears to be working correctly.
...
2. List the Hello World images downloaded on your machine.
Docker Image ls
Lists the Hello-world containers that were exited (generated by the mirror). If it is still running, the –all option is not required:
Docker container ls--all
container ID IMAGE COMMAND CREATED STATUS
54f4984ed6a8 Hello-world "/hello" seconds ago Exited (0) seconds ago
Command Review
# # List Docker CLI commands
Docker
docker container--help
# # Display docker version and info
Docker- -version
Docker version
docker info
# # Execute Docker image
Docker run Hello-world
# # List Docker images
docker image ls
# # List Docker containers (running, all, all in quiet mode)
Docker container LS
docker container ls--all
docker container Ls-aq
Summary
With Docker, the process of extending an application is to start a new executable file instead of running a heavy VM host.