运行 在 docker 堆栈中

Running atop in a docker stack

atop 是我在所有服务器上安装的工具,用于在调试站点事件时查看机器上发生的情况。在你的舰队中有"docker"到达运行顶峰的好方法吗,或者我应该在docker下方的os中登上运行ning?

与此相关的是我喜欢调试问题的所有其他工具:straceiotophtoptcpdumpperf、等。人们在生产中做了什么来覆盖这个利基市场。

您可以通过 运行 使用 --pid=host 连接容器来实现此目的(请参阅 Docker Run Reference

In certain cases you want your container to share the host’s process namespace, basically allowing processes within the container to see all of the processes on the system. For example, you could build a container with debugging tools like strace or gdb, but want to use these tools when debugging processes within the container.

可以在此处找到 Docker 由 Docker 维护者之一创建的 运行 htop 文件示例; https://github.com/jfrazelle/dockerfiles/blob/master/htop/Dockerfile (and many more great examples in that repository). An automated build of that image can be found on Docker Hub here; https://hub.docker.com/r/jess/htop/

运行像这样;

docker run --rm -it --pid host jess/htop