In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-30 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article introduces the knowledge of "how to install Docker on CentOS 7". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!
Docker is an open source tool that makes it easy to create and manage Linux containers. Containers are like lightweight virtual machines and can be started or stopped in milliseconds. Docker helps system administrators and programmers develop applications in containers and can be extended to thousands of nodes.
The main difference between containers and VM (virtual machines) is that containers provide process-based isolation, while virtual machines provide complete isolation of resources. It may take a minute for the virtual machine to start, while the container only takes a second or less. The container uses the kernel of the host operating system, while the virtual machine uses a separate kernel.
One of the limitations of Docker is that it can only be used on 64-bit operating systems.
In this article we will discuss how to install docker in CentOS 7.x.
Installation of Docker in CentOS 7
The Docker package is already included in the default CentOS-Extras software source. So to install docker, simply run the following yum command:
[root@localhost ~] # yum install docker starts the Docker service
After the installation is complete, use the following command to start the docker service and set it to boot:
[root@localhost ~] # service docker start [root@localhost ~] # chkconfig docker on
(LCTT translation note: the old sysv syntax is used here, such as the new systemd syntax supported in CentOS 7, as follows:
[root@localhost ~] # systemctl start docker.service [root@localhost ~] # systemctl enable docker.service
)
Download the official CentOS image locally (LCTT note: because the Docker is walled:-<, please use the http://docker.cn image, thanks to @ Ma Quanyi's image. )
[root@localhost ~] # docker pull centosPulling repository centos192178b11d36: Download complete 70441cac1ed5: Download complete ae0c2d0bdc10: Download complete 511136ea3c5a: Download complete 5b12ef8fd570: Download complete
Confirm that the CentOS image has been obtained:
[root@localhost ~] # docker images centosREPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZEcentos centos5 192178b11d36 2 weeks ago 466.9 MBcentos centos6 70441cac1ed5 2 weeks ago 215.8 MBcentos centos7 ae0c2d0bdc10 2 weeks ago 224 MBcentos latest ae0c2d0bdc10 2 weeks ago 224 MB
Run a Docker container:
[root@localhost] # docker run-I-t centos / bin/bash [root@dbf66395436d /] #
We can see that the CentOS container has been started, and we have got the bash prompt. In the docker command, we used the "- I capture standard input and output" and "- t assign a terminal or console" options. To disconnect from the container, enter exit.
[root@cd05639b3f5c /] # cat / etc/redhat-release CentOS Linux release 7.0.1406 (Core) [root@cd05639b3f5c /] # exitexit [root@localhost ~] #
We can also search containers based on Fedora and Ubuntu operating systems.
[root@localhost ~] # docker search ubuntu [root@localhost ~] # docker search fedora
Displays a list of currently running containers
That's all for "how to install Docker on CentOS 7". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!
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.