Get the App
SLTechnology News&Howtos  ›  Servers  › 

What are the monitoring commands in the docker container

Shulou Source: shulou.com Published: 2022-06-01 03:32:45 10月04日 Update

Today, I will talk to you about the monitoring commands in the docker container, which may not be well understood by many people. In order to make you understand better, the editor has summarized the following for you. I hope you can get something from this article.

Docker container monitoring can understand the operation of containers on the host as a whole. Let's introduce several monitoring commands in docker containers.

1.docker ps displays the running docker container information, including container name, container ID, container running status, image name, port mapping and other information, mainly to query the container ID.

Docker ps-a displays information for all containers

2.docker images views image information, including the library, name, version, ID, creation time, and actual size to which the image belongs.

3.docker stats

It is specially used for the statistics of container status information. The supporting API is (GET / containers/ (id) / stats). [note: different docker versions may have different API, and you need to decide according to your own docker version]

This command monitors the operation of container services during startup in real time, including CPU, memory, block devices, and network top O (somewhat similar to linux's top command) Ctrl + c exit

4.docker inspect

Users can use this command to view the details of the image or container, including basic configuration, host configuration, network configuration, transition information, and so on.

Docker inspect-f {{.NetworkSetting.IPAddress}}

Docker inspect | grep Network (combined with Linux pipeline | used by grep)

5.docker top this command can view the operation of processes inside the container and return relevant information about processes inside the container, including process number, parent process number, command, etc.

6.docker port specialized users query information about the port mapping between the container and the host

7.docker logs views container log information

After reading the above, do you have any further understanding of the monitoring commands in the docker container? If you want to know more knowledge or related content, please follow the industry information channel, thank you for your support.

Tags: Container information command monitoring running process image host content situation version configuration different status user port network query between memory Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Linux MySQL Apple OPPO Reno Shulou Information