diff --git a/kafka/Dockerfile b/kafka/Dockerfile new file mode 100644 --- /dev/null +++ b/kafka/Dockerfile @@ -0,0 +1,28 @@ +ARG REGISTRY=swh-jenkins +FROM $REGISTRY/tox + +USER root +RUN DEBIAN_FRONTEND=noninteractive apt-get update && \ + apt-get install -y --no-install-recommends \ + default-jdk && \ + rm -rf /var/lib/apt/lists/* + +# retrieve and uncompress kafka application, checking it's the +# expected archive we retrieve +ARG kafka=kafka_2.12-2.1.1 +ARG tarball=${kafka}.tgz +ARG expected_sha512sum=a2e8168e8de6b45e8fca1f2883f0744d3c5a939b70d8a47a5428b72188501d4c2fc11bc35759f2392680d4e8ecf2fa9d0e518e77fd28393afba22194ad018b10 +ARG signature=${tarball}.sha512 + +RUN wget http://apache.mirrors.ovh.net/ftp.apache.org/dist/kafka/2.1.1/${tarball} +RUN ( echo "${expected_sha512sum} ${tarball}" > ${signature} ) && \ + sha512sum -c ${signature} && \ + tar xvf ${tarball} -C /opt && \ + ln -s /opt/${kafka} /opt/kafka && \ + chown -R jenkins: /opt/kafka + + +FROM $REGISTRY/tox +WORKDIR /opt +COPY --from=0 /opt/ . +USER jenkins