Linux command
docker-top 命令
文本
复制后可按需替换文件名、目录或参数。
常用示例
Show running processes in container
docker top [container]
Show with BSD-style ps options (full info)
docker top [container] aux
Show with specific columns
docker top [container] -o pid,user,comm
Use container ID instead of name
docker top [container_id]
说明
docker top displays the processes running inside a container by querying the host's process list and filtering for that container's namespace. It is conceptually the same as docker container top and accepts arbitrary ps(1) options to control the output format. The container must be running; stopped containers cannot be inspected with this command. Output reflects the host's view of the processes (host PIDs), not the in-container PIDs.
FAQ
What is the docker-top command used for?
docker top displays the processes running inside a container by querying the host's process list and filtering for that container's namespace. It is conceptually the same as docker container top and accepts arbitrary ps(1) options to control the output format. The container must be running; stopped containers cannot be inspected with this command. Output reflects the host's view of the processes (host PIDs), not the in-container PIDs.
How do I run a basic docker-top example?
Run `docker top [container]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
Where can I find more docker-top examples?
This page includes 4 examples for docker-top, plus related commands for nearby Linux tasks.