1 FROM openjdk:8-jre-alpine3.9
3 ARG kafka_version=1.1.1
7 RUN apk add --update unzip wget curl jq coreutils bash
9 ENV KAFKA_VERSION=$kafka_version SCALA_VERSION=$scala_version
11 COPY download-kafka.sh \
12 kafka_server_jaas.conf \
13 org.onap.dmaap.mr.trust.jks \
14 org.onap.dmaap.mr.p12 \
15 org.onap.dmaap.mr.keyfile \
17 kafka11aaf-jar-with-dependencies.jar \
27 RUN chmod a+x /tmp/download-kafka.sh && sync && /tmp/download-kafka.sh && tar xfz /tmp/kafka_${SCALA_VERSION}-${KAFKA_VERSION}.tgz -C /opt && rm /tmp/kafka_${SCALA_VERSION}-${KAFKA_VERSION}.tgz && ln -s /opt/kafka_${SCALA_VERSION}-${KAFKA_VERSION} /opt/kafka
31 ENV KAFKA_HOME /opt/kafka
32 ENV PATH ${PATH}:${KAFKA_HOME}/bin
37 start-kafkaOrMirrorMaker.sh \
38 start-mirrormaker.sh \
41 RUN mkdir /opt/logs && \
42 touch /opt/logs/mmagent.log
44 # The scripts need to have executable permission
45 RUN chmod a+x /usr/bin/start-kafka.sh && \
46 chmod a+x /usr/bin/broker-list.sh && \
47 chmod a+x /usr/bin/start-kafkaOrMirrorMaker.sh && \
48 chmod a+x /usr/bin/start-mirrormaker.sh && \
49 chmod a+x /usr/bin/create-topics.sh
50 # Use "exec" form so that it runs as PID 1 (useful for graceful shutdown)
51 CMD ["start-kafkaOrMirrorMaker.sh"]
53 RUN addgroup -S -g 1000 mrkafka \
54 && adduser -S -u 1000 mrkafka mrkafka \
55 && chown -R mrkafka:mrkafka /opt/kafka/ /opt/logs/ /opt/etc/ /kafka/ /usr/bin/ /tmp/