From f73c940d3f4960d003bc8f83c100bdc4b900eb3a Mon Sep 17 00:00:00 2001 From: Kai Moritz Date: Tue, 14 Dec 2021 18:55:02 +0100 Subject: [PATCH] =?utf8?q?Toolbox=20-=20confluentinc/cp-kafka-connect=20+?= =?utf8?q?=20Weitere=20Tools=20f=C3=BCr=20die=20=C3=9Cbungen?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Zusätzlich verfügbare Tools: * curl * wget * nc * less * httpie * jq * kafkacat --- Dockerfile | 80 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ README.sh | 4 +++ 2 files changed, 84 insertions(+) create mode 100644 Dockerfile create mode 100755 README.sh diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..e318566 --- /dev/null +++ b/Dockerfile @@ -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 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 -- 2.20.1