How to check docker status

angryTom
Release: 2020-03-13 16:26:52
Original
8623 people have browsed it

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
Copy after login

2. View process information:

docker top nginx1
Copy after login

3. View the status of all containers

docker ps -a
Copy after login

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
Copy after login

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
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template