Centos Docker Install
# CentOS Docker Installation
Docker supports the following 64-bit CentOS versions:
* CentOS 9 (stream)
* Higher versions...
The centos-extras repository must be enabled. This repository is enabled by default. If you have disabled it, you need to re-enable it.
* * *
## Install using the official installation script
The installation command is as follows:
$ curl -fsSL https://get.docker.com -o install-docker.sh $ sudo sh install-docker.sh
* * *
## Manual installation
### Uninstall old versions
Older versions of Docker were called docker or docker-engine. If these are installed, uninstall them along with their dependencies.
Run the following command to uninstall old versions:
sudo dnf remove docker
docker-client
docker-client-latest
docker-common
docker-latest
docker-latest-logrotate
docker-logrotate
docker-engine
### Installation
### Install using Docker repository
Before installing Docker for the first time on a new host, you need to set up a Docker repository. After that, you can install and update Docker from the repository.
**Set up repository**
Install the dnf-plugins-core package (provides commands for managing DNF repositories), and set up the repository.
sudo dnf -y install dnf-plugins-core
Use the following command to set up the stable repository.
## Use official source address (relatively slow)
sudo dnf config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
You can execute the following command to switch to Tsinghua University mirror source:
## Tsinghua University Mirror Source
sed-i's+https://download.docker.com+https://mirrors.tuna.tsinghua.edu.cn/docker-ce+'/etc/yum.repos.d/docker-ce.repo
Reference: [https://mirrors.tuna.tsinghua.edu.cn/help/docker-ce/](https://mirrors.tuna.tsinghua.edu.cn/help/docker-ce/)
### Install
Run the following command to install Docker:
sudo dnf install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
If prompted to accept the GPG key, verify that the fingerprint matches 060A 61C5 1B55 8A7F 742B 77AA C52F EB6B 621E 9F35. If it matches, accept it.
After successful installation, start the Docker engine:
sudo systemctl start docker
If you want Docker to also start at system boot, you can use the following command:
sudo systemctl enable --now docker
The above command will configure Docker's systemd service to automatically start Docker at system boot.
Docker is not started by default after installation. And the docker user group has been created, but there are no users in this group.
Run the following command to verify the installation is successful:
sudo docker run hello-world
This command will download a test image and run it in a container. When the container runs, it will print a confirmation message and exit.
### Uninstall docker
Remove the installation package:
yum remove docker-ce
Remove images, containers, configuration files, etc.:
rm -rf /var/lib/docker
[](#)(#)
(#)[](#)
[ByteArk Coding Plan supports mainstream large models such as Doubao, GLM, DeepSeek, Kimi, MiniMax, with official direct supply for stability and reliability. Configuration Guide Β₯9.9/ Month - Activate Now](https://maas.xfyun.cn/modelSquare?ch=maas_lm_l2E)
###
YouTip