Environment: Linux centos8 4.18.0-80.el8.x86_ 64、docker-19.03.5
1. Preconditions
Requires OS kernel 3.10+
Uname - R // view the operating system version number
2. Check if it is installed (uninstalled)
yum remove docker \
docker-client \
docker-client-latest \
docker-common \
docker-latest \
docker-latest-logrotate \
docker-logrotate \
docker-engine
You can also uninstall in the following ways:
*Yum list installed | grep docker // find installed dockers
* yum remove docker-ce.x86_ 64 docker-ce-cli.x86_ 64 - Y // uninstall and install
*RM - RF / var / lib / docker // delete directory file
3. Set up warehouse
To install the required software package, yum utils provides Yum config manager, and the device mapper storage driver requires device mapper persistent data and lvm2
* yum install -y yum-utils \
device-mapper-persistent-data
lvm2
Set up a stable warehouse
yum-config-manager \
--add-repo \
https://download.docker.com/linux/centos/docker-ce.repo
4. Install docker engine community
yum install docker-ce docker-ce-cli containerd.io //The latest version is installed by default
Installation error, because Yum is installed containerd.io Too low, need to download and install higher version containerd.io >=1.2.2-3
Solution:
dnf install https://download.docker.com/linux/centos/7/x86_ 64/stable/Packages/ containerd.io -1.2.6-3.3.el7.x86_ 64. RPM // DNF is a better RPM tool
Then continue to install docker Ce (background service) and docker CE cli (client)
yum install docker-ce docker-ce-cli
5. Start docker service
* systemctl start docker
* systemctl enable docker
* systemctl status docker
6. Check whether the installation is successful
docker version
7. Docker other command test
* docker iamges
* docker ps
*Docker search image
8. Postscript
You can choose to install different versions of docker CE and docker CE cli
*Yum list docker CE -- showduplicates | sort - R // list of different versions
*Yum list docker CE cli -- showduplicates | sort - R // list of different versions
Installation:
yum install docker-ce-<VERSION_STRING> docker-ce-cli-<VERSION_STRING>
This work adoptsCC agreementReprint must indicate the author and the link of this article