Skip to content

Commit

Permalink
feat(ci): build kafka 4.0 from src for testing
Browse files Browse the repository at this point in the history
Whilst 4.0 isn't yet released, in order to allow us to do some up-front
testing, compile from src

Signed-off-by: Dominic Evans <[email protected]>
  • Loading branch information
dnwe committed Dec 23, 2024
1 parent dea7d4a commit f6a85f8
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions Dockerfile.kafka
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ FROM registry.access.redhat.com/ubi9/ubi-minimal:9.5@sha256:daa61d6103e98bccf40d
USER root

RUN microdnf update -y \
&& microdnf install -y gzip java-17-openjdk-headless tar tzdata-java \
&& microdnf install -y git gzip java-17-openjdk-headless tar tzdata-java \
&& microdnf reinstall -y tzdata \
&& microdnf clean all

Expand All @@ -24,7 +24,15 @@ ARG KAFKA_MIRROR="https://s3-us-west-2.amazonaws.com/kafka-packages"
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
RUN mkdir -p "/opt/kafka-${KAFKA_VERSION}" \
&& chmod a+rw "/opt/kafka-${KAFKA_VERSION}" \
&& curl -s "$KAFKA_MIRROR/kafka_${SCALA_VERSION}-${KAFKA_VERSION}.tgz" | tar xz --strip-components=1 -C "/opt/kafka-${KAFKA_VERSION}"
&& if [ "$KAFKA_VERSION" = "4.0.0" ]; then \
microdnf install -y java-17-openjdk-devel \
&& git clone --depth=1 --single-branch -b 4.0 https://github.com/apache/kafka /usr/src/kafka \
&& cd /usr/src/kafka && sed -e '/version=/s/-SNAPSHOT//' -i gradle.properties && ./gradlew releaseTarGz -x siteDocsTar -x javadoc \
&& tar xzf core/build/distributions/kafka_${SCALA_VERSION}-${KAFKA_VERSION}.tgz --strip-components=1 -C "/opt/kafka-${KAFKA_VERSION}" \
&& rm -rf /usr/src/kafka ; \
else \
curl -s "$KAFKA_MIRROR/kafka_${SCALA_VERSION}-${KAFKA_VERSION}.tgz" | tar xz --strip-components=1 -C "/opt/kafka-${KAFKA_VERSION}" ; \
fi

# older kafka versions depend upon jaxb-api being bundled with the JDK, but it
# was removed from Java 11 so work around that by including it in the kafka
Expand Down

0 comments on commit f6a85f8

Please sign in to comment.