diff --git a/hooks/build b/hooks/build index c5f3499..36e6eac 100755 --- a/hooks/build +++ b/hooks/build @@ -31,6 +31,7 @@ node-kafka-cache runtime-quarkus-ubuntu runtime-quarkus-ubuntu-jre runtime-quarkus-dev +kafka " AMD64ONLY=" @@ -85,3 +86,8 @@ done echo "amd64-only PUSH list contains: $PUSH" [ -z "$NOPUSH" ] || exit 0 for P in $PUSH; do docker push $P; done + +# Custom labling +JRE_MAJOR="$(head -n 1 java/Dockerfile | sed 's/[^:]*:\([[:digit:]]*\).*/\1/')" +KAFKA_VERSION="$(cat kafka/Dockerfile | grep 'ENV KAFKA_VERSION=' | sed 's/[^=]*=\([^ ]*\)*.*/\1/')" +crane cp yolean/kafka:latest yolean/kafka:$KAFKA_VERSION-java$JRE_MAJOR diff --git a/kafka/Dockerfile b/kafka/Dockerfile new file mode 100644 index 0000000..46ddcb2 --- /dev/null +++ b/kafka/Dockerfile @@ -0,0 +1,31 @@ +FROM --platform=$TARGETPLATFORM yolean/runtime-quarkus-ubuntu-jre:root + +ENV KAFKA_VERSION=3.1.0 SCALA_VERSION=2.13 + +RUN set -ex; \ + export DEBIAN_FRONTEND=noninteractive; \ + runDeps='ca-certificates netcat-openbsd'; \ + buildDeps='curl gnupg dirmngr'; \ + apt-get update && apt-get install -y $runDeps $buildDeps --no-install-recommends; \ + \ + curl -f -sLS -o KEYS https://www.apache.org/dist/kafka/KEYS; \ + gpg --import KEYS && rm KEYS; \ + \ + SCALA_BINARY_VERSION=$(echo $SCALA_VERSION | cut -f 1-2 -d '.'); \ + mkdir -p /opt/kafka; \ + curl -f -sLS -o kafka_$SCALA_BINARY_VERSION-$KAFKA_VERSION.tgz.asc https://www.apache.org/dist/kafka/$KAFKA_VERSION/kafka_$SCALA_BINARY_VERSION-$KAFKA_VERSION.tgz.asc; \ + curl -f -sLS -o kafka_$SCALA_BINARY_VERSION-$KAFKA_VERSION.tgz "https://www-eu.apache.org/dist/kafka/$KAFKA_VERSION/kafka_$SCALA_BINARY_VERSION-$KAFKA_VERSION.tgz"; \ + gpg --verify kafka_$SCALA_BINARY_VERSION-$KAFKA_VERSION.tgz.asc kafka_$SCALA_BINARY_VERSION-$KAFKA_VERSION.tgz; \ + tar xzf kafka_$SCALA_BINARY_VERSION-$KAFKA_VERSION.tgz --strip-components=1 -C /opt/kafka; \ + rm kafka_$SCALA_BINARY_VERSION-$KAFKA_VERSION.tgz; \ + \ + rm -rf /opt/kafka/site-docs; \ + mkdir /opt/kafka/logs && chgrp nogroup /opt/kafka/logs && chmod g+w /opt/kafka/logs; \ + \ + apt-get purge -y --auto-remove $buildDeps; \ + rm -rf /var/lib/apt/lists; \ + rm -rf /var/log/dpkg.log /var/log/alternatives.log /var/log/apt /root/.gnupg + +WORKDIR /opt/kafka +ENTRYPOINT [ "./bin/kafka-server-start.sh" ] +CMD [ "config/kraft/server.properties" ]