File tree Expand file tree Collapse file tree 2 files changed +24
-3
lines changed
Expand file tree Collapse file tree 2 files changed +24
-3
lines changed Original file line number Diff line number Diff line change 1+ # Using a build stage in order to build htop using the flag `--with-proc=/proc_host`
2+ # which allows it to use a custom location instead of `/proc`.
3+ FROM alpine:3.6 as builder
4+
5+ WORKDIR /build
6+ RUN apk add --update alpine-sdk build-base ncurses-dev autoconf automake curl unzip
7+ RUN curl -L https://github.com/hishamhm/htop/archive/master.zip --output htop.zip
8+ RUN unzip htop.zip
9+ RUN cd htop-master
10+
11+ WORKDIR /build/htop-master
12+ RUN sh autogen.sh
13+ RUN sh configure --prefix=/build/htop-master/dist --with-proc=/proc_host
14+ RUN make
15+ RUN make install
16+
17+
18+ # Main Container
119FROM alpine:3.6
220
321MAINTAINER Jonatha Daguerre <
[email protected] >
@@ -6,7 +24,6 @@ RUN apk add --no-cache \
624 bash \
725 bind-tools \
826 curl \
9- htop \
1027 iptraf-ng \
1128 iotop \
1229 jq \
@@ -19,3 +36,4 @@ RUN apk add --no-cache \
1936 tcpdump \
2037 vim
2138
39+ COPY --from=builder /build/htop-master/dist/bin/htop /usr/local/bin/
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ This project focus on providing system administration and troubleshooting tools
1010* ** bash** - GNU Bourne-Again SHell.
1111* ** bind-tools** - The ISC DNS tools (dig, nslookup, host).
1212* ** curl** - Tool to transfer data from or to a server.
13- * ** htop** - A ncurses-based process viewer for Linux.
13+ * ** htop** - A ncurses-based process viewer for Linux. (built from source, allows to watch the ** host's processes ** )
1414* ** iotop** - Simple top-like I/O monitor.
1515* ** iptraf-ng** - An IP Network Monitoring tool.
1616* ** jq** - Commandline JSON processor.
@@ -27,7 +27,9 @@ This project focus on providing system administration and troubleshooting tools
2727
2828Use ` --net=host ` allows ` tcpdump ` to access the host's network interfaces.
2929
30- Optionally you can create a local directory and map it to the container:
30+ Use ` -v /proc:/proc_host ` allows ` htop ` to watch the host's processes. Note that ` htop ` is unable to kill any host's processes.
31+
32+ Optionally you can create a local directory and map it to the container like ` -v /tmp/data/:/tmp/data/ ` :
3133
3234``` bash
3335mkdir /tmp/data
@@ -36,6 +38,7 @@ docker run \
3638 --rm \
3739 --name toolkit \
3840 --net=host \
41+ -v /proc:/proc_host \
3942 -v /tmp/data/:/tmp/data/ \
4043 -it \
4144 jonathadv/admin-toolkit \
You can’t perform that action at this time.
0 commit comments