Public | Automated Build

Last pushed: 9 months ago
Dockerfile
# Builds an image for Apache Kafka from binary distribution. # # The netflixoss/java base image runs Oracle Java 8 installed atop the # ubuntu:trusty (14.04) official image. Docker's official java images are # OpenJDK-only currently, and the Kafka project, Confluent, and most other # major Java projects test and recommend Oracle Java for production for optimal # performance. FROM netflixoss/java:8 MAINTAINER Ches Martin <ches@whiskeyandgrits.net> # The Scala 2.12 build is currently recommended by the project. ENV KAFKA_VERSION=0.10.2.1 KAFKA_SCALA_VERSION=2.12 JMX_PORT=7203 ENV KAFKA_RELEASE_ARCHIVE kafka_${KAFKA_SCALA_VERSION}-${KAFKA_VERSION}.tgz RUN mkdir /kafka /data /logs RUN apt-get update && \ DEBIAN_FRONTEND=noninteractive apt-get install -y \ ca-certificates # Download Kafka binary distribution ADD http://www.us.apache.org/dist/kafka/${KAFKA_VERSION}/${KAFKA_RELEASE_ARCHIVE} /tmp/ ADD https://dist.apache.org/repos/dist/release/kafka/${KAFKA_VERSION}/${KAFKA_RELEASE_ARCHIVE}.md5 /tmp/ WORKDIR /tmp # Check artifact digest integrity RUN echo VERIFY CHECKSUM: && \ gpg --print-md MD5 ${KAFKA_RELEASE_ARCHIVE} 2>/dev/null && \ cat ${KAFKA_RELEASE_ARCHIVE}.md5 # Install Kafka to /kafka RUN tar -zx -C /kafka --strip-components=1 -f ${KAFKA_RELEASE_ARCHIVE} && \ rm -rf kafka_* ADD config /kafka/config ADD start.sh /start.sh # Set up a user to run Kafka RUN groupadd kafka && \ useradd -d /kafka -g kafka -s /bin/false kafka && \ chown -R kafka:kafka /kafka /data /logs USER kafka ENV PATH /kafka/bin:$PATH WORKDIR /kafka # broker, jmx EXPOSE 9092 ${JMX_PORT} VOLUME [ "/data", "/logs" ] CMD ["/start.sh"]
Source Repository