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
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
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
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
After a while, the prompt is over
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
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
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 asdaemon.json
etc. - 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 info
the command to view the detailed information of Docker, including the installation path of Docker.
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.