From 471d42618d59184c51cf9e7fadf340be50d210d5 Mon Sep 17 00:00:00 2001 From: Ruakij Date: Wed, 23 Nov 2022 13:20:11 +0100 Subject: [PATCH 1/5] Add files for bandwhich --- README.md | 7 ++++++- tools/bandwhich/Dockerfile | 24 ++++++++++++++++++++++++ tools/bandwhich/info.env | 1 + 3 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 tools/bandwhich/Dockerfile create mode 100644 tools/bandwhich/info.env diff --git a/README.md b/README.md index d6d6370..ec5b205 100644 --- a/README.md +++ b/README.md @@ -7,10 +7,15 @@ Collection of Dockerfiles created to build & pack various tools. - [1. Tools](#1-tools) + - [1.1. Bandwhich](#11-bandwhich)
# 1. Tools -Nothing yet +## 1.1. Bandwhich + +>This is a CLI utility for displaying current network utilization by process, connection and remote IP/hostname + +Source: https://github.com/imsnif/bandwhich diff --git a/tools/bandwhich/Dockerfile b/tools/bandwhich/Dockerfile new file mode 100644 index 0000000..5cbd3fb --- /dev/null +++ b/tools/bandwhich/Dockerfile @@ -0,0 +1,24 @@ +# ---- Base ---- +FROM alpine:3 AS base +WORKDIR /app + + +# ---- Build ---- +FROM rust:alpine AS build +WORKDIR /build +# Install packages +RUN apk add --no-cache make libc-dev build-base +# Copy sources +ADD .build/repository/ . +# Update dependencies +RUN cargo update +# Compile +RUN TARGET="release" make + + +# ---- Release ---- +FROM base AS release +# Copy build-target +COPY --from=build /build/target/release/bandwhich . + +CMD ["./bandwhich"] diff --git a/tools/bandwhich/info.env b/tools/bandwhich/info.env new file mode 100644 index 0000000..51a3a79 --- /dev/null +++ b/tools/bandwhich/info.env @@ -0,0 +1 @@ +GIT_REPOSITORY=https://github.com/imsnif/bandwhich From 14e9f7ee3540fa8c6058c064f19c348ce2a0f84e Mon Sep 17 00:00:00 2001 From: Ruakij Date: Wed, 23 Nov 2022 18:41:36 +0100 Subject: [PATCH 2/5] Combine update and make --- tools/bandwhich/Dockerfile | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/tools/bandwhich/Dockerfile b/tools/bandwhich/Dockerfile index 5cbd3fb..2cdbfe9 100644 --- a/tools/bandwhich/Dockerfile +++ b/tools/bandwhich/Dockerfile @@ -10,10 +10,8 @@ WORKDIR /build RUN apk add --no-cache make libc-dev build-base # Copy sources ADD .build/repository/ . -# Update dependencies -RUN cargo update -# Compile -RUN TARGET="release" make +# Update dependencies and Compile +RUN cargo update && TARGET="release" make # ---- Release ---- From 637bb11fdded0bddfdf1b343322ff42737988922 Mon Sep 17 00:00:00 2001 From: Ruakij Date: Wed, 23 Nov 2022 18:41:59 +0100 Subject: [PATCH 3/5] Switch to entrypoint --- tools/bandwhich/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/bandwhich/Dockerfile b/tools/bandwhich/Dockerfile index 2cdbfe9..04a16f4 100644 --- a/tools/bandwhich/Dockerfile +++ b/tools/bandwhich/Dockerfile @@ -19,4 +19,4 @@ FROM base AS release # Copy build-target COPY --from=build /build/target/release/bandwhich . -CMD ["./bandwhich"] +ENTRYPOINT ["./bandwhich"] From 6e1e63cad13d26e38e56c30dbacd24d1134d69e6 Mon Sep 17 00:00:00 2001 From: Ruakij Date: Wed, 23 Nov 2022 18:42:34 +0100 Subject: [PATCH 4/5] Add example command --- README.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index ec5b205..1c4fc3b 100644 --- a/README.md +++ b/README.md @@ -16,6 +16,14 @@ Collection of Dockerfiles created to build & pack various tools. ## 1.1. Bandwhich +### 1.1.1. Source >This is a CLI utility for displaying current network utilization by process, connection and remote IP/hostname -Source: https://github.com/imsnif/bandwhich +https://github.com/imsnif/bandwhich + +
+ +### 1.1.2. Example +``` +docker run --net host bandwhich -i eth0 +``` From 7e2a97bf0d643e2deb125b2baf4ffa657175a2c0 Mon Sep 17 00:00:00 2001 From: Ruakij Date: Wed, 23 Nov 2022 19:16:07 +0100 Subject: [PATCH 5/5] Change example to interactive --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 1c4fc3b..6c334a9 100644 --- a/README.md +++ b/README.md @@ -25,5 +25,5 @@ https://github.com/imsnif/bandwhich ### 1.1.2. Example ``` -docker run --net host bandwhich -i eth0 +docker run -it --net host bandwhich -i eth0 ```