In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-27 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)05/31 Report--
This article mainly introduces CentOS7 how to install and use Docker related knowledge, the content is detailed and easy to understand, the operation is simple and fast, has a certain reference value, I believe you will have a harvest after reading this CentOS7 how to install and use Docker article, let's take a look at it.
Installation
Docker officially provides a set of installation scripts to simplify the installation process, which can be used on centos systems:
Curl-ssl https://get.docker.com/ | sh
After executing this command, the script automatically prepares everything and installs docker on the system.
However, due to the great wall, there may be some download errors when using this script in China. Some domestic cloud service providers have provided a modified version of this script to use the domestic docker software source mirror installation, so as to avoid wall interference.
Aliyun installation script
The copy code is as follows:
Curl-ssl | sh
Mirror image
Select a domestic mirror image
Official accelerator in China
The copy code is as follows:
Sudo echo "docker_opts=\"-registry-mirror= https://registry.docker-cn.com\"" > > / etc/default/docker
Official accelerators are recommended.
NetEase 163
The copy code is as follows:
Sudo echo "docker_opts=\"-registry-mirror= http://hub-mirror.c.163.com\"" > > / etc/default/docker
At present, the NetEase mirror image has been relatively stable.
After modifying the default image repository, you need to restart docker to take effect:
Service docker restart
Use
Start docker
Service docker start
Boot self-start
Sudo chkconfig docker on
Stop docker
Service docker start
List of local images
Docker images
Use the images command to check and find that there are no mirrors in the current local area.
Search
Docker search hello
The following results are all the images we searched for related to "hello"
Pull the image
Docker pull hello-world
We tried to pull the image named "hello-world" from the repository
After the pull is successful, use the docker images command to check and find that the image has been pulled locally.
Run Mirror
Docker run hello-world
After running, the image will output the following information:
Image renaming
Docker tag hello-world hw
We renamed the previously downloaded "hello_world" image to "hw", and using the images command to view it, we will find that there is already an additional image named "hw" in the list.
Delete Mirror
Docker rmi hello-world
We have deleted the image named "hello_world". The parameters after rmi can also be image short id, image length id, image name or image summary.
Unloading
List installation packages
Yum list installed | grep docker
Delete installation package
Yum-y remove docker-engine.x86_64yum-y remove docker-engine-selinux.noarch
Delete images / containers, etc.
This is the end of the article rm-rf / var/lib/docker on "how to install and use Docker in CentOS7". Thank you for reading! I believe you all have a certain understanding of "how to install and use Docker in CentOS7". If you want to learn more, you are welcome to follow the industry information channel.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.