How to install Docker environment by yum under CentOS7
This article mainly explains "how to install the Docker environment in yum under CentOS7". The content in the article is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn "how to install the Docker environment in yum under CentOS7".
Record the steps to install the Docker environment using yum under CentOS 7.
1. Remove the old version:
Yum remove docker\ docker-client\ docker-client-latest\ docker-common\ docker-latest\ docker-latest-logrotate\ docker-logrotate\ docker-selinux\ docker-engine-selinux\ Docker-enginerm-rf / etc/systemd/system/docker.service.drm-rf / var/lib/dockerrm-rf / var/run/dockerrm-rf / usr/local/dockerrm-rf / etc/docker
2. Install some necessary system tools:
Yum- y install yum-utils device-mapper-persistent-data lvm2
3. Add software source information:
Yum-config-manager-- add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
4. Update the yum cache:
Yum makecache fast
5. Install Docker-ce:
Yum-y install docker-ce
6. Start the Docker backend service:
Systemctl start docker
7. Test run hello-world:
Docker run hello-world
8. Install centos and run centos by starting it in the background:
Docker run-itd centos / bin/bash
9. Enter the centos image:
[root@myserver ~] # docker psCONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMESf57d4703adc3 centos "/ bin/bash" About a minute ago Up About a minute jolly_ dhawan [root @ myserver ~] # docker exec-it f57d4703adc3 / bin/bash [root@f57d4703adc3 /] # [root@f57d4703adc3 /] # Cat / etc/RedHat-release CentOS Linux release 7.6.1810 (Core) [root@f57d4703adc3 /] # Thank you for reading The above is the content of "how to install the Docker environment in yum under CentOS7". After the study of this article, I believe you have a deeper understanding of how to install the Docker environment in yum under CentOS7, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!