In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)05/31 Report--
This article mainly explains "what are the skills of using Docker". The content of the explanation is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn "what are the skills of using Docker".
1. Docker top
This command is used to view the process information in a container. For example, if you want to see how many nginx processes are in a nginx container, you can do this:
Docker top 3b307a09d20dUID PID PPID C STIME TTY TIME CMDroot 805 787 0 Jul13? 00:00:00 nginx: master process nginx-g daemon off;systemd+ 941 8050 Jul13? 00:03:18 nginx: worker process2. Docker load & & docker save
I usually use these two commands to download packaged Kubernetes images, because you know that the Internet speed in China is not as fast as abroad. Sorted out a complete version of PDF in the Java interview dictionary
Docker save can save an image to a tar file, and you can do this:
~ docker save registry:2.7.1 > registry-2.7.1.tar# and docker load can import images from tar files into docker ~ docker load < registry-2.7.1.tar3. Docker search
This command can help you easily search for images in DockerHub on the command line, such as:
~ docker search nginxNAME DESCRIPTION STARS OFFICIAL AUTOMATEDnginx Official build of Nginx. 13519 [OK] jwilder/nginx-proxy Automated Nginx reverse proxy for docker con... 1846 [OK] richarvey/nginx-php-fpm Container running Nginx + PHP-FPM capable of … [OK] linuxserver/nginx An Nginx container, brought to you by LinuxS... 123bitnami/nginx Bitnami nginx Docker Image 87 [OK] tiangolo/nginx-rtmp Docker image with Nginx using the nginx-rtmp... [OK] jc21/nginx-proxy-manager Docker container for managing Nginx proxy ho... 73alfg/nginx-rtmp NGINX, nginx-rtmp-module and FFmpeg from sou... 71 [OK] nginxdemos/hello NGINX webserver that serves a simple page co... 57 [OK] jlesage/nginx-proxy-manager Docker container for Nginx Proxy Manager 53 [OK] nginx/nginx-ingress NGINX Ingress Controller for Kubernetes 37.
Of course, this function may not be very easy to use in China, because.
4. Docker events
This command can help you get all kinds of event information about docker in real time, such as creating a container.
~ docker events2020-07-28T21:28:46.000403018+08:00 image load sha256:432bf69f0427b52cad10897342eaf23521b7d973566354118e9a59c4d31b5fae (name=sha256:432bf69f0427b52cad10897342eaf23521b7d973566354118e9a59c4d31b5fae) 5. Docker update
When you docker run and find that there are some parameters that are not the state you want, such as the nginx container cpu you set or the memory is too small, you can use docker update to modify these parameters.
~ docker update nginx-- cpus 26. Docker history
You can use this command when you modify an image but forget the modify command for each layer, or when you want to see how an image is built, such as:
~ docker history traefik:v2.1.6IMAGE CREATED CREATED BY SIZE COMMENT5212a87ddaba 5 months ago / bin/sh-c # (nop) LABEL org.opencontainers. 0B 5 months ago / bin/sh-c # (nop) CMD ["traefik"] 0B 5 months ago / bin/sh-c # (nop) ENTRYPOINT ["/ entrypoint. 0B 5 months ago / bin/sh-c # (nop) EXPOSE 800B 5 months ago / bin/sh-c # (nop) COPY file:59a219a1fb7a9dc8 … 419B 5 months ago / bin/sh-c set-ex; apkArch= "$(apk-- print- …" 52.9MB 5 months ago / bin/sh-c apk-- no-cache add ca-certificate... 1.85MB 6 months ago / bin/sh-c # (nop) CMD ["/ bin/sh"] 0B 6 months ago / bin/sh-c # (nop) ADD file:a1906f14a4e217a49 … 4.81MB7. Docker wait
This command can check the exit status of the container, such as:
~ docker wait 7f7f0522a7d00
This way you can know whether the container exits normally or abnormally.
8. Docker pause & & docker unpause
You can use this command when you run a container but want to pause it.
~ docker pause 7f7f0522a7d09. Docker diff
You can use this command when you run a container, but you don't know which files have been modified in the container, such as:
~ docker diff 38c59255bf6eC / etcA / etc/localtimeC / varC / var/libA / var/lib/registry10. Docker stats
This is the docker built-in monitoring command, which you can use when you want to see how all the containers under the current host are taking up memory and cpu. Sorted out a complete version of PDF in the Java interview dictionary
~ docker statsCONTAINER ID NAME CPU% MEM USAGE / LIMIT MEM% NET I BLOCK O PIDS1c5ade04e7f9 redis 0.08% 17.53MiB / 47.01GiB 0.04% 10.9GB / 37GB 0B / 0B 4afe6d4ebe409 kafka-exporter 0.09% 16.91MiB / 47.01GiB 0.04% 1.97GB / 1.53GB 752MB / 0B 23f0c7c01a9c34 kafka-docker_zookeeper 0.01% 308.8MiB / 47.01GiB 0.64% 20.2MB / 12.2MB 971MB / 3 .29MB 28da8c5008955f kafka-docker_kafka-manager 0.08% 393.2MiB / 47.01GiB 0.82% 1.56MB / 2.61MB 1.14GB / 0B 60c8d51c583c49 kafka-docker_kafka 1.63% 1.256GiB / 47.01GiB 2.67% 30.4GB / 48.9GB 22. 3GB / 5.77GB 85. Thank you for your reading, these are the contents of "what are the skills for the use of Docker?" after the study of this article, I believe you have a deeper understanding of the skills in the use of Docker, 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!
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.