diff options
author | Simon Hrabos <simon.hrabos@tieto.com> | 2019-07-25 14:13:15 +0200 |
---|---|---|
committer | Simon Hrabos <simon.hrabos@tieto.com> | 2019-07-25 14:15:48 +0200 |
commit | 46d8250f0c0884991e00593ec05477c0759efd57 (patch) | |
tree | 46c72bfb05e70859e613ea84b1923fc29f5f8ba8 /src | |
parent | 9c9daff4cc8ba0b4af515e63f53decd849ccd8f9 (diff) |
small, multi-platform (amd64, arm64) images
Modify kafka docker image due to arm64 compatibility
Issue-ID: INT-912
Issue-ID: INT-933
Signed-off-by: Simon Hrabos <simon.hrabos@tieto.com>
Change-Id: Ie2e359450812fd5ec92a3faf9c9162ae5c287331
Diffstat (limited to 'src')
-rw-r--r-- | src/main/docker/Dockerfile | 67 |
1 files changed, 47 insertions, 20 deletions
diff --git a/src/main/docker/Dockerfile b/src/main/docker/Dockerfile index 46343cf..d5ce240 100644 --- a/src/main/docker/Dockerfile +++ b/src/main/docker/Dockerfile @@ -1,24 +1,48 @@ -FROM anapsix/alpine-java +FROM alpine:3.7 + +ENV LANG C.UTF-8 + +RUN echo "http://dl-cdn.alpinelinux.org/alpine/edge/testing" >> /etc/apk/repositories +RUN { \ + echo '#!/bin/sh'; \ + echo 'set -e'; \ + echo; \ + echo 'dirname "$(dirname "$(readlink -f "$(which javac || which java)")")"'; \ + } > /usr/local/bin/docker-java-home \ + && chmod +x /usr/local/bin/docker-java-home +ENV JAVA_HOME /usr/lib/jvm/java-1.8-openjdk/jre +ENV PATH $PATH:/usr/lib/jvm/java-1.8-openjdk/jre/bin:/usr/lib/jvm/java-1.8-openjdk/bin + +ENV JAVA_VERSION 8u212 +ENV JAVA_ALPINE_VERSION 8.212.04-r0 + +RUN set -x \ + && apk add --no-cache \ + openjdk8-jre="$JAVA_ALPINE_VERSION" \ + && [ "$JAVA_HOME" = "$(docker-java-home)" ] ARG kafka_version=1.1.1 ARG scala_version=2.12 - -RUN apk add --update unzip wget curl docker jq coreutils +RUN apk add --no-cache unzip wget docker curl jq coreutils libstdc++ ca-certificates bash java-cacerts ENV KAFKA_VERSION=$kafka_version SCALA_VERSION=$scala_version -ADD download-kafka.sh /tmp/download-kafka.sh -ADD kafka_server_jaas.conf /tmp/kafka_server_jaas.conf -ADD org.onap.dmaap.mr.trust.jks /tmp/org.onap.dmaap.mr.trust.jks -ADD org.onap.dmaap.mr.p12 /tmp/org.onap.dmaap.mr.p12 -ADD org.onap.dmaap.mr.keyfile /tmp/org.onap.dmaap.mr.keyfile -ADD cadi.properties /tmp/cadi.properties -ADD mmagent.config /opt/etc/mmagent.config -ADD consumer.properties /opt/etc/consumer.properties -ADD producer.properties /opt/etc/producer.properties -ADD kafka11aaf-jar-with-dependencies.jar /tmp/kafka11aaf-jar-with-dependencies.jar -ADD dmaapMMAgent.jar /tmp/dmaapMMAgent.jar -ADD kafka-run-class.sh /tmp/kafka-run-class.sh + +COPY download-kafka.sh \ + kafka_server_jaas.conf \ + org.onap.dmaap.mr.trust.jks \ + org.onap.dmaap.mr.p12 \ + org.onap.dmaap.mr.keyfile \ + cadi.properties \ + kafka11aaf-jar-with-dependencies.jar \ + dmaapMMAgent.jar \ + kafka-run-class.sh \ + /tmp/ + +COPY mmagent.config \ + consumer.properties \ + producer.properties \ + /opt/etc/ 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 @@ -26,11 +50,14 @@ VOLUME ["/kafka"] ENV KAFKA_HOME /opt/kafka ENV PATH ${PATH}:${KAFKA_HOME}/bin -ADD start-kafka.sh /usr/bin/start-kafka.sh -ADD broker-list.sh /usr/bin/broker-list.sh -ADD create-topics.sh /usr/bin/create-topics.sh -ADD start-kafkaOrMirrorMaker.sh /usr/bin/start-kafkaOrMirrorMaker.sh -ADD start-mirrormaker.sh /usr/bin/start-mirrormaker.sh + +COPY start-kafka.sh \ + broker-list.sh \ + create-topics.sh \ + start-kafkaOrMirrorMaker.sh \ + start-mirrormaker.sh \ + /usr/bin/ + RUN mkdir /opt/logs RUN touch /opt/logs/mmagent.log # The scripts need to have executable permission |