From 0b51282a629c1d85fa09e2de5fb026874ba2c907 Mon Sep 17 00:00:00 2001 From: Yonatan Kiron Date: Sun, 25 Mar 2018 18:26:23 +0300 Subject: [PATCH 1/2] Update kafka 10 to newer alpine Motivation - current version doesn't use /etc/resolv.conf which prevents kubernetes usage with the current image. See https://github.com/gliderlabs/docker-alpine/issues/8 --- Dockerfile | 9 +++++++-- download-kafka.sh | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 2999addc..ad89db10 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,11 +2,16 @@ FROM anapsix/alpine-java MAINTAINER Wurstmeister -RUN apk add --update unzip wget curl docker jq coreutils +RUN echo "http://dl-cdn.alpinelinux.org/alpine/v3.7/main" > /etc/apk/repositories && \ + apk update && \ + apk add --update unzip wget curl jq coreutils ENV KAFKA_VERSION="0.10.0.0" SCALA_VERSION="2.11" ADD download-kafka.sh /tmp/download-kafka.sh -RUN /tmp/download-kafka.sh && tar xfz /tmp/kafka_${SCALA_VERSION}-${KAFKA_VERSION}.tgz -C /opt && rm /tmp/kafka_${SCALA_VERSION}-${KAFKA_VERSION}.tgz +RUN /tmp/download-kafka.sh && \ + tar xfz /tmp/kafka_${SCALA_VERSION}-${KAFKA_VERSION}.tgz -C /opt && \ + rm /tmp/kafka_${SCALA_VERSION}-${KAFKA_VERSION}.tgz && \ + rm -rf /var/cache/apk/* VOLUME ["/kafka"] diff --git a/download-kafka.sh b/download-kafka.sh index 2ddc911e..f524ab5b 100755 --- a/download-kafka.sh +++ b/download-kafka.sh @@ -1,5 +1,5 @@ #!/bin/sh -mirror=$(curl --stderr /dev/null https://www.apache.org/dyn/closer.cgi\?as_json\=1 | jq -r '.preferred') +mirror="https://archive.apache.org/dist/" url="${mirror}kafka/${KAFKA_VERSION}/kafka_${SCALA_VERSION}-${KAFKA_VERSION}.tgz" wget -q "${url}" -O "/tmp/kafka_${SCALA_VERSION}-${KAFKA_VERSION}.tgz" From 0ec2297a8ea47bd31137d4be109efdf58a86f9dd Mon Sep 17 00:00:00 2001 From: Yonatan Kiron Date: Mon, 26 Mar 2018 13:07:06 +0300 Subject: [PATCH 2/2] Remove cache removal --- Dockerfile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index ad89db10..653beed1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -10,8 +10,7 @@ ENV KAFKA_VERSION="0.10.0.0" SCALA_VERSION="2.11" ADD download-kafka.sh /tmp/download-kafka.sh RUN /tmp/download-kafka.sh && \ tar xfz /tmp/kafka_${SCALA_VERSION}-${KAFKA_VERSION}.tgz -C /opt && \ - rm /tmp/kafka_${SCALA_VERSION}-${KAFKA_VERSION}.tgz && \ - rm -rf /var/cache/apk/* + rm /tmp/kafka_${SCALA_VERSION}-${KAFKA_VERSION}.tgz VOLUME ["/kafka"]