Home  >  Article  >  Operation and Maintenance  >  How to check docker status

How to check docker status

angryTom
angryTomOriginal
2020-03-13 16:26:528526browse

How to check the running status of docker container? Sometimes, we need to enter the running docker container, check the running status of the container, and check the status information of the docker container.

How to check docker status

How to check the docker status

1. Check the container status:

docker stats nginx1

2. View process information:

docker top nginx1

3. View the status of all containers

docker ps -a

Use docker inspect to view the underlying information of Docker. It will return a JSON file recording the configuration and status information of the Docker container

Default directory of the docker container:

/var/lib/docker/containers目录下 12 位开头的 就是 容器ID
inspect 内容就是 config.v2.json 文件
cat /var/lib/docker/containers/23defb07e362b81fa9d282382dfb5101e7a269f97b3d167493a5b1e031d15120/config.v2.json

inspect View the configuration information of the container, including container name, environment variables, and running commands , host configuration, network configuration and data volume configuration

docker inspect nginx1 查看容器所有状态;
root@rbtnode1: ~# docker inspect --format='{{.NetworkSettings.IPAddress}}' nginx1172.16.57.5
root@rbtnode1: ~# docker inspect --format '{{.Name}} {{.State.Running}}' nginx1/nginx1 true

For more related tutorials, please pay attention to the docker tutorial column on the PHP Chinese website.

The above is the detailed content of How to check docker status. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn