In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/02 Report--
Centos how to install docker service, many novices are not very clear about this, in order to help you solve this problem, the following editor will explain for you in detail, people with this need can come to learn, I hope you can gain something.
1. It is best to update the kernel before installation
Yum update
As shown in the picture, the kernel has been updated
If there is a problem with the yum source, you can replace it with Ali's. For specific operations, please refer to my other article about updating the yum source https://my.oschina.net/qbj/blog/3000037.
two。 Go to the official download installation script
Curl-fsSL https://get.docker.com-o get-docker.sh
Note: you can put any directory at will.
3. Run the installation script
Sh get-docker.sh
4. Start docker
Sudo systemctl start docker
5. Check to see if docker starts successfully
Systemctl status docker
As shown in the figure, the status of running indicates that the startup is successful.
6. Docker common commands
Systemctl status docker / / View the status of docker service systemctl start docker / / start docker service systemctl stop docker / / stop docker service systemctl restart docker / / restart dokcer service docker pull image name: image version number / / download image docker images from docker official image repository / / View local image docker ps / / View run Docker ps-a / / View all containers-docker run [OPTIONS] IMAGE [COMMAND] [ARG...] / / create a new container and run it. Common OPTIONS instructions:-a stdin: specify standard input and output content types Optional three items of STDIN/STDOUT/STDERR -d: run the container in the background and return the container ID;-i: run the container in interactive mode, usually used with-t;-p: specify the port mapping, format: host (host) port: container port-t: reassign a pseudo-input terminal to the container, usually used with-I;-- name= "nginx-lb": specify a name for the container -- dns 8.8.8.8: specify the DNS server used by the container, default is the same as the host;-- dns-search example.com: specify the container DNS search domain name, default is the same as the host;-h "mars": specify the hostname;-e username= "ritchie" of the container: set the environment variable;-- env-file= []: read the environment variable from the specified file -- cpuset= "0-2" or-- cpuset= "0Magne1Magne2": bind the container to the specified CPU to run;-m: set the maximum memory used by the container;-- net= "bridge": specify the network connection type of the container, support bridge/host/none/container: four types;-- link= []: add a link to another container;-- expose= []: open a port or a group of ports -- volume -v: bind a volume / / for example, run a nginxdocker run-- name nginx-d-p 81:80-- privileged=true-- restart=always-m 2048M-- memory-swap-1-v / usr/nginx/logs:/var/log/nginx-d nginx:latest -- docker start Container name / / Startup Container docker stop Container name / / stopped Container docker restart Container name / / restart Container docker rm Container name / / Delete Container-you must stop the container to delete the container docker inspect Container name / / View container details docker logs-f-- tail=100 container name / / View container log and specify the number of log lines as 100docker rmi image name: image version number / / delete image-you must delete the container before deleting the image. 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.