centos7 installation docker detailed steps
environment requirements: centos7.0 or above (docker supports the minimum version)
steps are as follows:
1. Delete the previously installed docker (if it has not been installed before, this step is omitted...)
Enter the root directory of centos and execute the following command (\ is a command line break in the Linux system, if the command is too long, you can use \ to break the line)
yum remove docker \
docker-client \
docker-client-latest \
docker- common \
docker-latest \
docker-latest-logrotate \
docker-logrotate \
docker-sqlinux \
docker-engine-selinux \
docker-engine \
docker-ce
Two, virtual machine networking, install yum tool
Execute the following command
yum install -y yum-utils \
devi ce-mapper-pers istent-data \
1vm2 --ski p- broken
3. Set the docker image source
Execute the following command
yum-config-manager \
--add-repo \
https://mirrors.aliyun.com/docker-ce/1inux/centos/docker-ce.repo
sed -i 's/download.docker.com/mirrors.aliyun.com\/docker-ce/g'
/etc/yum.repos.d/docker-ce.repo
yum makecache fast
4. Install docker (if the network speed is slow, you need to wait)
yum install -y docker-ce
**
**
5. Preparation before starting docker**
(The docker application needs to use various ports, and it is troublesome to set them one by one. It is recommended to close the firewall directly) Please say the important thing three times: before starting docker, you must close the firewall, before starting docker, you must close the firewall, before starting docker, Be sure to close the firewall (you can check whether it is closed by checking the status of the firewall before closing)
#关闭
systemctl stop firewalld
#禁止开机启动防火墙
systemctl disable firewalld
6. Start docker
systemctl start docker
There are many ways to check whether the startup is successful
(1)查看状态:systemctl status docker
(2)查看docker 版本