Running atop in a docker stack Running atop in a docker stack docker docker

Running atop in a docker stack


You can achieve this by running the container with --pid=host (See the 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.

An example of a Dockerfile to run htop created by one of the Docker Maintainers can be found here; 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/

Run it like this;

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