01. CentOS7 install docker

Install Docker tutorial on CentOS7 64-bit system

Docker is a popular containerization platform that helps developers easily run applications in different containers. Below are the detailed steps to install Docker on CentOS7 64-bit system.

Step 1: Update the system

Before installing Docker, you first need to update your system's packages and dependencies.

慎重!如果你的CentOS系统是才搭建好可以更新,但是如果有其他服务,请慎重更新,避免对其他服务的依赖造成影响!

sudo yum update -y

i have updated
insert image description here

Step 2: Install Docker dependencies

Installing Docker requires some dependencies, which can be installed using the following command.

sudo yum install -y yum-utils device-mapper-persistent-data lvm2

insert image description here

Step 3: Add Docker repository

Docker officially provides the Docker repository, which can be added to the system. At the same time, domestic mirror sources are also added so that the download speed is faster

sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo

sudo yum-config-manager --add-repo https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo

[External link picture transfer failed, the source site may have an anti-theft link mechanism, it is recommended to save the picture and upload it directly (img-ONepn9hy-1682397708052) (D:\Personal Files\Black Group Related\Personal Black Group flashing process DS918+ xs_42962\docker related\MD image resources\add docker source image-20230425123033767.png)]

Step 4: Install Docker

Docker can now be installed using the following command.

docker-ce is the community version, docker-ee is the enterprise version, among which the Docker community version is free and open source, which is an ideal choice for individuals and small teams; the Docker enterprise version is charged, which is specially designed for enterprises and large Provided by the IT team, it is used in business applications with strict requirements.

sudo yum install -y docker-ce

[External link picture transfer failed, the source site may have an anti-theft link mechanism, it is recommended to save the picture and upload it directly (img-GhLZrWsk-1682397708053) (D:\Personal Files\Black Group Related\Personal Black Group flashing process DS918+ xs_42962\docker related\MD image resources\install dockerimage-20230425123310031.png)]

After a while, the prompt is over
[External link picture transfer failed, the source site may have an anti-theft link mechanism, it is recommended to save the picture and upload it directly (img-QehrKBin-1682397708054) (D:\Personal Files\Black Group Related\Personal Black Group flashing process DS918+ xs_42962\docker-related\MD image resource\complete image-20230425123438768.png)]

Step 5: Start and enable the Docker service

After installing Docker, you need to start and enable the Docker service so that it starts automatically when the system starts.

sudo systemctl start docker 
sudo systemctl enable docker

insert image description here

Step 6: Verify Docker Installation

Use the following command to verify that Docker is installed successfully.

sudo docker --version

The following message appears to indicate that the installation is complete

[External link picture transfer failed, the source site may have an anti-theft link mechanism, it is recommended to save the picture and upload it directly (img-jR9S645z-1682397708055) (D:\Personal Files\Black Group Related\Personal Black Group flashing process DS918+ xs_42962\docker-related\MD image resource\verify dockerimage-20230425123641465.png)]

docker installation information

On CentOS7 64-bit system, Docker is installed in the following directory by default:

  • Docker binaries: /usr/bin/docker: Contains the binary executable for the Docker engine.
  • Docker configuration file: /etc/docker: Contains Docker configuration files, such as daemon.jsonetc.
  • Docker data directory: /var/lib/docker: Contains data such as Docker containers, images, and volumes.
  • Docker startup script: /usr/lib/systemd/system/docker.service: Contains Docker's systemd service configuration file, which is used to manage the start and stop of Docker services.

Note: The above path is the default installation path of Docker. The actual installation path may vary due to system configuration and installation method. For example, if you use an unofficial installation method, the installation path may be different. You can run docker infothe command to view the detailed information of Docker, including the installation path of Docker.

[External link picture transfer failed, the source site may have an anti-theft link mechanism, it is recommended to save the picture and upload it directly (img-5gJwsOEv-1682397708056) (D:\Personal Files\Black Group Related\Personal Black Group flashing process DS918+ xs_42962\docker related\MD image resources\docker info image-20230425124056985.png)]

So far, Docker has been successfully installed on the CentOS7 64-bit system.

Hope this tutorial helps you! You are now ready to start using Docker to create and manage containerized applications.

Guess you like

Origin blog.csdn.net/qq_29711355/article/details/130362322