Docker study notes (1)-basic introduction

What is a container?

Summarize the container in one sentence: a container is to package software into a standardized unit for development, delivery, and deployment.

  • A container image is a lightweight, executable, independent software package that contains all the content needed for the software to run: code, runtime environment, system tools, system libraries, and settings.
  • Containerized software is suitable for applications based on Linux and Windows, and can run consistently in any environment.
  • Containers give software independence and protect it from external environmental differences (for example, differences in development and rehearsal environments), thereby helping to reduce conflicts between teams running different software on the same infrastructure.

Docker thought

  • container
  • Standardization: ①transportation method, ②storage method, ③API interface
  • isolation

Features of Docker containers

  • Lightweight, multiple Docker containers running on a machine can share the operating system kernel of this machine; they can be started quickly and only take up very little computing and memory resources. The image is constructed through the file system layer and shares some common files. In this way, the disk usage can be reduced as much as possible, and the image can be downloaded faster.
  • Standards, Docker containers are based on open standards and can run on all mainstream Linux versions, Microsoft Windows, and any infrastructure including VMs, bare metal servers, and clouds.
  • Security, the isolation that Docker gives applications is not limited to isolation from each other, but also independent of the underlying infrastructure. Docker provides the strongest isolation by default, so application problems are only the problem of a single container, and will not affect the entire machine.

Container VS virtual machine

To put it simply: Containers and virtual machines have similar advantages in resource isolation and allocation, but their functions are different. Because the container virtualizes the operating system, not the hardware, the container is easier to transplant and more efficient.

Container stack exampleVirtual machine stack example

Three basic concepts of Docker

  • Image: a special file system
  • Container: the entity that mirrors the runtime
  • Repository: a place where mirror files are stored centrally

Build, Ship and Run

  • Build (build image): The image is like a container including files, operating environment and other resources.
  • Ship (transport mirroring): Transport between the host and the warehouse. The warehouse here is like a super terminal.
  • Run: The running image is a container, and the container is the place to run the program.

Guess you like

Origin blog.csdn.net/qq_14997473/article/details/89855038