How to check container service status in docker

王林
Release: 2020-04-14 13:33:48
Original
12287 people have browsed it

How to check container service status in docker

1. Check the container status:

docker stats nginx1
Copy after login

2. Check the process information:

docker top nginx1
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.

3. View all status of the container:

docker inspect nginx1
Copy after login
root@rbtnode1: ~# docker inspect --format='{{.NetworkSettings.IPAddress}}' nginx1 172.16.57.5 root@rbtnode1: ~# docker inspect --format '{{.Name}} {{.State.Running}}' nginx1 /nginx1 true
Copy after login

Recommended tutorial:docker tutorial

The above is the detailed content of How to check container service status in docker. 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
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!