diff --git a/Dockerfile b/Dockerfile index 5ed07c4..0c1a2a1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,7 +4,10 @@ FROM debian:bookworm-slim as builder RUN apt-get update && apt-get -y install gcc make COPY * /tmp/ RUN cd tmp && make && ls -la +RUN apt-get -y clean && rm -rf /var/lib/apt/lists/* FROM debian:bookworm-slim +RUN apt-get update && apt-get -y install dnsutils && apt-get -y clean && rm -rf /var/lib/apt/lists/* COPY --from=builder /tmp/flowgen /usr/bin/ -ENTRYPOINT ["/usr/bin/flowgen"] +COPY --from=builder /tmp/flowgen_wrapper.sh /usr/bin/ +ENTRYPOINT ["/usr/bin/flowgen_wrapper.sh"] diff --git a/flowgen_wrapper.sh b/flowgen_wrapper.sh new file mode 100755 index 0000000..04c099a --- /dev/null +++ b/flowgen_wrapper.sh @@ -0,0 +1,9 @@ +#!/bin/bash +set -e + +# Attempt to resolve domain name +IP=$(dig +short +search ${@: -1}) + +#Print resolution +echo "Sending flow records to ${IP}..." +flowgen ${@:1:$#-1} ${IP}