Learn more about the basic concepts of docker of docker mirrors containers and warehouses

  • 2020-05-17 07:20:23
  • OfStack

This article focuses on introducing you to the basic concepts of docker mirrors, containers, and warehouses.

Docker concept

Docker is an open source application container engine that allows developers to package their applications and dependencies into a portable container and release them to any popular Linux machine, as well as virtualization. Containers are completely sandboxed and have no interfaces with each other.

The mirror

The Docker mirror is a read-only template.

For example, an image can contain a full CentOS operating system environment with only httpd or other applications installed for the user.

Mirroring can be used to create Docker containers.

Docker provides a simple mechanism for creating an image or updating an existing image, and users can even download a ready-made image from someone else to use it directly.

The container

Docker USES containers to run applications.

The container is a running instance created from the image. It can be started, started, stopped, deleted. Each container is an isolated, secure platform.

Think of the container as a simple version of the Linux environment (including root user permissions, process space, user space, and network space) and the applications running in it.

* note: the image is read-only, and the container creates a writable layer at startup as the top layer.

warehouse

A repository is a centralized repository for mirrored files. Sometimes the warehouse and the warehouse registration server (Registry) are mixed into 1, and the distinction is not strictly made. In fact, the warehouse registry server often houses multiple warehouses, each containing multiple images, each with a different label (tag).

Warehouses are divided into public warehouses (Public) and private warehouses (Private).

The largest public repository is Docker Hub, which holds a large number of images for users to download. It serves as the default docker repository, but downloads are slow in China. Of course, users can also create a private repository within the local network. Once the user has created his own image, he can use the push command to upload it to a public or private repository, so that the next time he USES the image on another machine, he can simply drop pull from the repository.
* note: the concept of Docker repository is similar to that of Git. The registration server can be understood as a hosted service like GitHub.

docker container installation

RedHat/CentOS must be at least version 6.6, or 7.x to install docker. It is recommended to use docker on RedHat/CentOS 7, since RedHat/CentOS 7 has an upgraded kernel to kernel 3.10 and better support for lxc containers.

Install docker centos6. 6


rpm -ivh http://mirrors.yun-idc.com/epel/6Server/x86_64/epel-release-6-8.noarch.rpm
yum install docker-io 
chkconfig docker on
service docker start
docker version

Startup encountered problems

Question: Docker# esdocker dead but pid file exists

Solutions:


yum-config-manager --enable public_ol6_latest
yum install device-mapper-event-libs 

Related articles: