Docker preliminary exploration (1)-Docker installation and understanding

The most intuitive explanation of what Docker does?

  • Before: I built a war package in the development environment and want to run it under Linux. We have to download Java, Tomcat, and MySQL on Linux first, configure the corresponding environment variables, and drop the war package into Tomcat's webapps folder before it can run.
  • Use docker: Pull an image directly under Linux (all environments are equipped), run the image, and drop the war package.

Three concepts of Docker:

  • Image: Similar to the image in a virtual machine, it is a read-only template for the Docker engine that contains a file system. Any application needs an environment to run, and mirroring is used to provide this operating environment. For example, an Ubuntu image is a template that contains the Ubuntu operating system environment. Similarly, installing Apache software on the image can be called an Apache image.
  • Container: Similar to a lightweight sandbox, it can be regarded as a minimal Linux system environment (including root privileges, process space, user space and network space, etc.), as well as applications running in it . The Docker engine uses containers to run and isolate applications. A container is an application instance created by an image, which can be created, started, stopped, and deleted. The containers are isolated from each other and do not affect each other. Note: The image itself is read-only. When the container is started from the image, Docker creates a writable layer on the upper layer of the image, and the image itself remains unchanged.
  • Repository: Similar to the code repository, here is the mirror repository, which is the place where Docker centrally stores mirror files. Pay attention to the difference with the registration server (Registry): the registration server is the place where the warehouse is stored, and there are usually multiple warehouses; while the warehouse is the place where the mirrors are stored, generally each warehouse stores one type of mirror, and each mirror is distinguished by tag. For example, the Ubuntu warehouse stores multiple versions (12.04, 14.04, etc.) of Ubuntu images.

 

Docker installation under Linux: (I am using the Red Hat version)

1. Install the required packages

2. Set up the warehouse

3. During installation, you need to enter yes twice

4. Verify that the installation is successful

 

 

 

Guess you like

Origin blog.csdn.net/hzkcsdnmm/article/details/107251432