Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kafka image for yolean/kubernetes-kafka #13

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions hooks/build
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ node-kafka-cache
runtime-quarkus-ubuntu
runtime-quarkus-ubuntu-jre
runtime-quarkus-dev
kafka
"

AMD64ONLY="
Expand Down Expand Up @@ -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
31 changes: 31 additions & 0 deletions kafka/Dockerfile
Original file line number Diff line number Diff line change
@@ -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" ]