SoFunction
Updated on 2025-03-09

Detailed explanation of the basic concepts of Docker tutorials (mirrors, containers, warehouses)

Mirror

Docker includes three basic concepts

  • Image
  • Container
  • Repository

By understanding these three concepts, you will understand the entire life cycle of Docker.

Docker image

A Docker image is a read-only template.

For example: a mirror can contain a complete ubuntu operating system environment, where only Apache or other applications required by the user are installed.

Mirrors can be used to create Docker containers.

Docker provides a very simple mechanism to create images or update existing images, and users can even download an already-made image from others to use directly.

Docker container

Docker uses containers to run applications.

A container is a running instance created from a mirror. It can be started, started, stopped, deleted. Each container is a platform that is isolated from each other and ensures security.

You can think of a container as a simple version of Linux environment (including root user permissions, process space, user space, and network space, etc.) and applications running there.

Note:The mirror is read-only, and the container creates a writable layer as the top layer when it is started.

Docker repository

A warehouse is a place where mirror files are stored centrally. Sometimes the warehouse and the warehouse registration server are confused and there is no strict distinction. In fact, multiple warehouses are often stored on the warehouse registration server, and each warehouse contains multiple images, each mirror has a different tag (tag).

Warehouses are divided into two forms: public warehouses and private warehouses.

The largest public repository is Docker Hub, which stores a large number of images for users to download. Domestic public warehouses include Docker Pool, etc., which can provide more stable and fast access for mainland users.

Of course, users can also create a private repository within the local network.

After the user creates his own image, he can use the push command to upload it to a public or private repository. In this way, the next time he uses this image on another machine, he only needs to pull it from the repository.

Note:The concept of Docker repository is similar to Git, and the registration server can be understood as a hosting service like GitHub.

Thank you for reading, I hope it can help you. Thank you for your support for this site!