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--
CentOS7 how to install and use Docker, many novices are not very clear about this, in order to help you solve this problem, the following editor will explain in detail for you, people with this need can come to learn, I hope you can gain something.
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
View docker version
[root@localhost ~] # docker versionClient: Version: 1.8.3 API version: 1.20 Go version: go1.4.2 Git commit: cedd534-dirty Built: Fri Jan 22 06:07:01 UTC 2016 OS/Arch: linux/amd64Server: Version: 1.8.3 API version: 1.20 Go version: go1.4.2 Git commit: cedd534-dirty Built: Fri Jan 22 06:07:01 UTC 2016 OS/Arch: linux/amd64
The display version is docker 1.83 Magi API version 1.20.
Start the Docker service
After the installation is complete, use the following command to start the docker service and set it to boot:
[root@localhost ~] # systemctl start docker.service [root@localhost ~] # systemctl enable docker.service
Download the official CentOS image to local
[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 see 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
[root@localhost ~] # docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMESe422481ac1ce daocloud.io/daocloud/dao-2048 "nginx-g'daemon off" 45 hours ago Up 45 hours 0.0.0.0 daemon off 32768-> 80/tcp hungry_visvesvaraya, is it helpful for you to read the above content? If you want to know more about the relevant knowledge or read more related articles, please follow the industry information channel, thank you for your support.
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.