aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDoug Szumski <doug@stackhpc.com>2018-03-08 17:03:01 +0000
committerDoug Szumski <doug@stackhpc.com>2018-03-12 12:32:40 +0000
commitaf6c19203fbc88ee615ee995853f48e0586be065 (patch)
tree3be0c95af2688e241f2ccfe9363e9d3fb0347976
parent553a51bdbc9a715c25c1ac6f1c26771f5b975b22 (diff)
downloadkolla-af6c19203fbc88ee615ee995853f48e0586be065.tar.gz
kolla-af6c19203fbc88ee615ee995853f48e0586be065.zip
Support configuration of Kafka package
This change makes it easier to configure the Kafka package. This is useful, for example, when installing Monasca which currently requires an older version of Kafka than that installed here. The change also fixes an issue with circular symlinks, updates kafka and verifies the sha512sum of the package. The sha512sum was taken from here: https://www.apache.org/dist/kafka/1.0.1/kafka_2.12-1.0.1.tgz.sha512 Change-Id: I79a5a32ee8e5edd915fa88fbc00d0d4ac08b8ebd Partially-Implements: blueprint monasca-roles
-rw-r--r--docker/kafka/Dockerfile.j220
1 files changed, 13 insertions, 7 deletions
diff --git a/docker/kafka/Dockerfile.j2 b/docker/kafka/Dockerfile.j2
index 4a809aaad..5eab225a9 100644
--- a/docker/kafka/Dockerfile.j2
+++ b/docker/kafka/Dockerfile.j2
@@ -5,7 +5,7 @@ LABEL maintainer="{{ maintainer }}" name="{{ image_name }}" build-date="{{ build
{% import "macros.j2" as macros with context %}
-{{ macros.configure_user(name='kafka', homedir='/kafka') }}
+{{ macros.configure_user(name='kafka', homedir='/opt/kafka') }}
{% if base_distro in ['centos', 'oraclelinux', 'rhel'] %}
{% set kafka_packages = [
@@ -19,16 +19,22 @@ LABEL maintainer="{{ maintainer }}" name="{{ image_name }}" build-date="{{ build
{{ macros.install_packages(kafka_packages | customizable("packages")) }}
+{% block kafka_version %}
+ENV kafka_version=1.0.1
+ENV kafka_scala_version=2.12
+ENV kafka_url=http://apache.osuosl.org/kafka/${kafka_version}/kafka_${kafka_scala_version}-${kafka_version}.tgz
+ENV kafka_pkg_sha512sum=935c0df1cf742405c40d9248cfdd1578038b595b59ec5a350543a7fe67b6be26ff6c4426f7c0c072ff4aa006b701502a55fcf7e2ced1fdc64330e3383035078c
+{% endblock %}
+
{% block kafka_install %}
-RUN curl -o kafka.tgz http://apache.osuosl.org/kafka/1.0.0/kafka_2.12-1.0.0.tgz \
- && tar xfvz kafka.tgz \
- && rm kafka.tgz \
- && ln -s kafka* kafka
+RUN curl -sSL -o /tmp/kafka.tgz ${kafka_url} \
+ && echo "${kafka_pkg_sha512sum} /tmp/kafka.tgz" | sha512sum -c \
+ && tar --strip 1 -xvf /tmp/kafka.tgz -C /opt/kafka \
+ && rm -f /tmp/kafka.tgz
{% endblock %}
COPY extend_start.sh /usr/local/bin/kolla_extend_start
-RUN chmod 755 /usr/local/bin/kolla_extend_start \
- && chown -R kafka: /kafka
+RUN chmod 755 /usr/local/bin/kolla_extend_start
{% block kafka_footer %}{% endblock %}
{% block footer %}{% endblock %}