Docker learning (1): a basic introduction to Docker

I have been in touch with Docker before, but I don’t know much about it, so I write a blog about Docker today. The purpose is twofold: 1. Learn about Docker through the blog system; 2. Learn with you bloggers through the blog!

First of all, I checked the relevant acceptance of Docker from Baidu Encyclopedia: Docker is an open source application container engine that allows developers to package their applications and dependent packages into a portable container, and then publish it to any popular Linux machine or On Windows machines, virtualization can also be achieved. Containers use the sandbox mechanism completely, and there will be no interfaces between them.

Docker is an open source application container engine, based on the  Go language  and open source in compliance with the Apache2.0 protocol.

A complete Docker consists of the following parts:

  1. DockerClient client
  2. Docker Daemon daemon
  3. Docker Image mirror
  4. Docker Container container

Docker official website: https://www.docker.com/

Github Docker source code: https://github.com/docker/docker-ce

1. Docker architecture

The Docker architecture contains three basic concepts:

  • Image is
    equivalent to a root file system. The mirror image is composed of multiple layers. After each layer is superimposed, it looks like an independent object from the outside. Inside the image is a streamlined operating system (OS), and it also contains files and dependencies necessary for the application to run.
    Docker镜像是(Image)就是一个只读的模板,它可以是一个运行软件(tomcat/mysql),也可以是一个系统(centos/ubuntu)
    Container
    (Container) The relationship between the image (Image) and the container (Container) is like the class and instance in object-oriented programming. The image is a static definition, and the container is the entity of the image at runtime. Containers can be created, started, stopped, deleted, suspended and other operations.
  • Repository
    warehouse can be regarded as a code control center for storing images.
    Similar to GitHub storing project code, except that Docker Hub stores images (Image) from the origin.
    There is a difference between Repository and Registry. The warehouse registration server often stores multiple warehouses, and each warehouse contains multiple mirrors, and each mirror has a different tag (tag, similar version number).
Docker Object-oriented
container Object
Mirror image class

 

 Docker basic concept description

Read Description

Docker image (Images)

Docker image is a template used to create Docker containers, such as Ubuntu system.

Docker container (Container)

A container is an application or a group of applications that run independently, and is an entity that mirrors the runtime.

Docker client (Client)

The Docker client uses the Docker SDK ( https://docs.docker.com/develop/sdk/ ) to communicate with the Docker daemon through the command line or other tools .

Docker host (Host)

A physical or virtual machine is used to execute the Docker daemon and container.

Docker Registry

The Docker warehouse is used to store images, which can be understood as a code warehouse in code control.

Docker Hub ( https://hub.docker.com ) provides a huge collection of images for use.

A Docker Registry can contain multiple repositories; each repository can contain multiple tags; each tag corresponds to a mirror.

Usually, a warehouse will contain images of different versions of the same software, and tags are often used to correspond to each version of the software. We can use the format of <warehouse name>:<tag> to specify which version of the software is the mirror. If no label is given, latest will be   used as the default label.

Docker Machine

Docker Machine is a command line tool that simplifies the installation of Docker. You can install Docker on the corresponding platforms through a simple command line, such as VirtualBox, Digital Ocean, and Microsoft Azure.

Two, Docker application scenarios

  1. Automated packaging and publishing of web applications
  2. Automated testing, continuous integration and release
  3. Deploy and adjust databases or other background applications in a service-oriented environment
  4. Compile Hu from scratch or extend the existing OpenShit or Cloud Foundry platform to build your own PaaS environment

Three, the advantages of Docker

Docker is an open platform for developing, delivering and running applications. Docker enables you to separate your application from the infrastructure so you can deliver software quickly. With Docker, you can manage your infrastructure in the same way you manage applications. By leveraging Docker's method to quickly deliver, test, and deploy code, you can greatly reduce the delay between writing code and running it in a production environment.

1. Deliver your application quickly and consistently

Docker allows developers to use the local containers of the applications or services you provide to work in a standardized environment, thereby simplifying the development life cycle.

Containers are very suitable for continuous integration and continuous delivery (CI/CD) workflows. Please consider the following example scenarios:

  • Your developers write code locally and use Docker containers to share their work with colleagues.
  • They use Docker to push their applications into the test environment and perform automated or manual testing.
  • When developers find errors, they can fix them in the development environment, and then redeploy them to the test environment for testing and verification.
  • After the test is completed, pushing the patch to the production environment is as simple as pushing the updated image to the production environment.

2. Responsive deployment and expansion

Docker is a container-based platform that allows highly portable workloads. Docker containers can be run on the developer's native machine, on a physical or virtual machine in the data center, on a cloud service, or in a hybrid environment.

Docker's portability and lightweight features can also enable you to easily complete the workload of dynamic management, and according to business needs instructions, real-time expansion or removal of applications and services.

3. Run more workloads on the same hardware

Docker is light and fast. It provides a feasible, economical, and efficient alternative to virtual machines based on hypervisors, so you can use more computing power to achieve business goals. Docker is very suitable for high-density environments and small and medium-sized deployments, and you can do more with fewer resources.

The above is only an introduction to the basic situation of Docker. In fact, the author is also a little knowledgeable, and slowly accumulates in the process of later learning...

 

Next: Docker learning (two)-Docker installation and configuration

-------------------------------------------------- ----------------------
author: World coding
source: CSDN
original: https://blog.csdn.net/dgxin_605/article/details/106164347
copyright notice : This article is the original article of the blogger, please attach a link to the blog post if you reprint it!

------------------------------------------------------------------------

 

 

Guess you like

Origin blog.csdn.net/dgxin_605/article/details/106164347