Basic concepts of docker images, containers, and repositories
Image
1.Docker images are read-only templates.
For example: An image can contain a complete CentOS operating system environment, with only httpd or other applications needed by the user installed.
2.Images can be used to create Docker containers.
3.Docker provides a very simple mechanism to create images or update existing images, and users can even directly download a ready-made image from others to use directly.
Container
- Docker uses containers to run applications.
- A container is a running instance created from an image. It can be started, started, stopped, and deleted. Each container is isolated and ensures a secure platform.
- You can consider a container as a simplified version of a Linux environment (including root user permissions, process space, user space, and network space) and the application running in it.
- *Note: Images are read-only, and a writable layer is created as the top layer when the container starts.
Repository
- The repository is a place for centralized storage of image files. Sometimes, the repository and the repository registry (Registry) are confused with each other and not strictly distinguished. In fact, the repository registry often stores multiple repositories, each containing multiple images, and each image has different tags (tags).
- Repositories are divided into two forms: public repositories (Public) and private repositories (Private).
- The largest public repository is Docker Hub, which stores a large number of images for users to download. It is the default docker repository, but the download speed is very slow in China. Of course, users can also create a private repository within the local network. After the user creates their own image, they can use the push command to upload it to a public or private repository. In this way, when using this image on another machine next time, it only needs to be pulled down from the repository.
- *Note: The concept of Docker repository is similar to Git, the registration server can be understood as a hosting service like GitHub.
RedHat docker container installation
RedHat/CentOS must6.6version above, or7version .x can install docker, it is recommended to install docker on/CentOS 7using docker on/CentOS 7kernel has been upgraded to 3.10with better support for lxc containers.
centos6.6Install docker
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
Problems encountered when starting
Problem: Docker#docker dead but pid file exists
Solution:
yum-config-manager --enable public_ol6_latest
yum install device-mapper-event-libs
Thank you for reading, I hope it can help everyone, thank you for your support to this site!