What is a container?

  • Container images are lightweight, executable, stand-alone packages that contain everything you need to run your software: code, runtime environment, system tools, system libraries, and Settings.

  • Containerized software is suitable for Linux – and Windows-based applications and runs consistently in any environment.

  • Containers help reduce conflicts between teams running different software on the same infrastructure by giving software independence from external environmental differences (for example, differences in development and rehearsal environments).

Illustrates physical machines, virtual machines, and containers

What is a Docker

  • Docker is the world’s leading software container platform.

  • Docker uses the Go language launched by Google for development and implementation. Based on cgroup, Namespace, AUFS class UnionFS and other technologies, Docker encapsulates and isolates processes, which is a virtualization technology at the operating system level. Since a quarantined process is independent of the host and other quarantined processes, it is also called a container. Docke was originally implemented based on LXC.

  • Docker automates repetitive tasks, such as setting up and configuring development environments, freeing up developers to focus on what really matters: building great software.

  • Users can easily create and use containers and put their own applications into containers. Containers can also be versioned, copied, shared, and modified just like normal code.

Docker thought

  • container

  • Standardization: ① mode of transportation, ② mode of storage, ③API interface

  • isolation

Docker container features

  • Lightweight, multiple Docker containers running on one machine can share the operating system kernel of that machine; They can start quickly and require very few computing and memory resources. Mirrors are constructed through the file system layer and share some common files. This minimizes disk usage and allows images to be downloaded more quickly.

  • Standards, Docker containers are based on open standards and can run on all major Linux versions, Microsoft Windows, and any infrastructure including VMS, bare-metal servers, and the cloud.

  • Security. Docker allows applications to be isolated not only from each other, but also from the underlying infrastructure. Docker provides maximum isolation by default, so when an application has a problem, it is a problem in a single container, not across the entire machine.

Why Docker

  • Docker image provides a complete runtime environment in addition to the kernel, to ensure the consistency of the application running environment, so that there will no longer be “no problem with this code on my machine ah” such problems; — Consistent operating environment

  • The startup time can be in the order of seconds or even milliseconds. Greatly saving the development, testing, deployment time. — Faster startup time

  • Avoid public servers, where resources are vulnerable to other users. – isolation,

  • Good at dealing with server usage stress of concentrated outbreak; — Elastic expansion and rapid expansion

  • Applications running on one platform can be easily migrated to another platform without worrying about running in a different environment. — Easy to migrate

  • With Docker, continuous integration, continuous delivery and deployment can be achieved by customizing application images. — Continuous delivery and deployment

Comparison diagram

Containers and Virtual Machines (VMS) summary

  • A container is an application-layer abstraction for packaging code and dependent resources together. Multiple containers can run on the same machine, sharing the operating system kernel, but each running as a separate process in user space. Compared to virtual machines, containers take up less space (container images are usually only a few tens of megabytes in size) and can be started instantaneously.

  • A virtual machine (VM) is a physical hardware layer abstraction for turning one server into multiple servers. Hypervisors allow multiple VMS to run on one machine. Each VM contains a complete set of operating systems, one or more applications, the necessary binaries, and library resources, and therefore takes up a lot of space. VM startup is also slow.

Containers and virtual machines (VMS) can coexist

  • Image

  • Container

  • Repository

Image – a special file system
Container – The image runtime entity
Repository – A centralized place where image files are stored

  • Build: An image is like a container containing resources such as files and runtime environments.

  • Ship: Transport between the mainframe and the warehouse, which is like a Superterminal.

  • Run (Run image) : A running image is a container, and the container is the place to Run the program.

Click to view the original article