A lightweight Docker image for htop, the interactive process viewer.
Pull and run the latest image:
docker run --rm -it --pid=host jonbaldie/htopClone the repository and build locally with make:
git clone https://github.com/jonbaldie/htop.git
cd htop
make buildOr build directly with Docker:
docker build -t jonbaldie/htop .It easily enables system monitoring on Linux flavours like CoreOS where host installations of packages are limited or forbidden.
The docker run command above is also a super-easy one-liner that instantly gives you a clear and trusted system monitoring dashboard.
If you only see a few processes rather than everything running on the host, make sure you are using --pid=host:
docker run --rm -it --pid=host jonbaldie/htopWithout this flag Docker isolates the container's process namespace, so htop can only see itself.
Some system information requires elevated privileges. If htop gives permission errors, check that the user running the container (or the Docker daemon) has access to /proc. Running the command with sudo usually fixes it:
sudo docker run --rm -it --pid=host jonbaldie/htopIf the screen looks wrong or htop exits immediately, you probably forgot the -it flags. htop needs an interactive TTY to draw its interface:
-itells Docker to keep STDIN open-tallocates a pseudo-TTY
Use both together:
docker run --rm -it --pid=host jonbaldie/htop(c) 2017 Jonathan Baldie