File tree 2 files changed +24
-3
lines changed 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
1
19
FROM alpine:3.6
2
20
3
21
MAINTAINER Jonatha Daguerre <
[email protected] >
@@ -6,7 +24,6 @@ RUN apk add --no-cache \
6
24
bash \
7
25
bind-tools \
8
26
curl \
9
- htop \
10
27
iptraf-ng \
11
28
iotop \
12
29
jq \
@@ -19,3 +36,4 @@ RUN apk add --no-cache \
19
36
tcpdump \
20
37
vim
21
38
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
10
10
* ** bash** - GNU Bourne-Again SHell.
11
11
* ** bind-tools** - The ISC DNS tools (dig, nslookup, host).
12
12
* ** 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 ** )
14
14
* ** iotop** - Simple top-like I/O monitor.
15
15
* ** iptraf-ng** - An IP Network Monitoring tool.
16
16
* ** jq** - Commandline JSON processor.
@@ -27,7 +27,9 @@ This project focus on providing system administration and troubleshooting tools
27
27
28
28
Use ` --net=host ` allows ` tcpdump ` to access the host's network interfaces.
29
29
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/ ` :
31
33
32
34
``` bash
33
35
mkdir /tmp/data
@@ -36,6 +38,7 @@ docker run \
36
38
--rm \
37
39
--name toolkit \
38
40
--net=host \
41
+ -v /proc:/proc_host \
39
42
-v /tmp/data/:/tmp/data/ \
40
43
-it \
41
44
jonathadv/admin-toolkit \
You can’t perform that action at this time.
0 commit comments