Toolbox - confluentinc/cp-kafka-connect + Weitere Tools für die Übungen
authorKai Moritz <kai@juplo.de>
Tue, 14 Dec 2021 17:55:02 +0000 (18:55 +0100)
committerKai Moritz <kai@juplo.de>
Sun, 3 Apr 2022 06:49:09 +0000 (08:49 +0200)
Zusätzlich verfügbare Tools:

* curl
* wget
* nc
* less
* httpie
* jq
* kafkacat

Dockerfile [new file with mode: 0644]
README.sh [new file with mode: 0755]

diff --git a/Dockerfile b/Dockerfile
new file mode 100644 (file)
index 0000000..e318566
--- /dev/null
@@ -0,0 +1,80 @@
+ARG VERSION=6.2.0
+
+FROM confluentinc/cp-base-new:${VERSION}
+
+WORKDIR /build
+
+ENV BUILD_PACKAGES="which git make cmake gcc-c++ zlib-devel curl curl-devel openssl-devel cyrus-sasl-devel pkgconfig lz4-devel wget tar findutils"
+
+
+USER root
+
+ENV KAFKACAT_VERSION="1.7.0"
+RUN \
+  echo "Preparing the build-environment ....." && \
+  dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm && \
+  dnf install -y $BUILD_PACKAGES && \
+  echo "Building kafkacat ....." && \
+  git clone https://github.com/edenhill/kafkacat && \
+  cd kafkacat && \
+  git checkout tags/$KAFKACAT_VERSION && \
+  ./bootstrap.sh && \
+  make && \
+  ldd kcat && \
+  cd /build
+
+# TODO...
+#
+# ENV NORMCAT_VERSION="1.1.1"
+# RUN \
+#   echo "Fetching normcat ....." && \
+#   wget https://github.com/andmarios/normcat/releases/download/${NORMCAT_VERSION}/normcat-${NORMCAT_VERSION}-linux-amd64-lowmem.tar.gz -O normcat.tgz && \
+#   tar -xzf normcat.tgz -C /build/
+#
+# ENV PUMBA_VERSION="0.6.5"
+# RUN \
+#   echo "Fetching pumba ....." && \
+#   wget https://github.com/alexei-led/pumba/releases/download/${PUMBA_VERSION}/pumba_linux_amd64 && \
+#   mv pumba_linux_amd64 pumba && \
+#   chmod a+x pumba
+#
+# RUN \
+#   echo "Fetching zk-smoketest ....." && \
+#   wget https://github.com/phunt/zk-smoketest/archive/master.zip -O zk-smoketest.zip && \
+#   unzip zk-smoketest.zip && \
+#   echo "installing zktop ....." && \
+#   pip install -b . -t ./zk-smoketest-master zktop && \
+#   echo "Building zkpython ....." && \
+#   pip install -b . -t ./zk-smoketest-master zkpython
+
+
+
+FROM confluentinc/cp-kafka-connect:${VERSION}
+
+USER root
+RUN \
+  echo "Installing runtime dependencies for SSL and SASL support ...." && \
+  microdnf install dnf && \
+  dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm && \
+  dnf install -y ca-certificates && \
+  echo "Installing usefull tools" && \
+  dnf install -y curl wget nc less httpie jq -y && \
+  pip install httpie && \
+  echo "===> clean up ..."  && \
+  dnf clean all && \
+  rm -rf /tmp/*
+
+COPY --from=0 /build/kafkacat/kcat /usr/local/bin/
+# COPY --from=0 /build/normcat /usr/local/bin/
+# COPY --from=0 /build/pumba /usr/local/bin/
+# COPY --from=0 /build/zk-smoketest-master /usr/local/bin/
+RUN \
+  ln -s /usr/local/bin/kcat /usr/local/bin/kafkacat && \
+  chmod a+x /usr/local/bin/*
+
+# Specify a default mount point and working directory
+VOLUME ["/mnt"]
+WORKDIR /mnt
+
+# Define default command.
+CMD ["bash", "-i"]
diff --git a/README.sh b/README.sh
new file mode 100755 (executable)
index 0000000..58068ed
--- /dev/null
+++ b/README.sh
@@ -0,0 +1,4 @@
+#!/bin/sh
+
+docker build -t juplo/toolbox .
+docker run --rm juplo/toolbox ls /usr/local/bin