From 0eb897533f9d9f1eb3e40d0d74f592c14fe291f1 Mon Sep 17 00:00:00 2001 From: Staffan Olsson Date: Wed, 26 Jul 2017 05:07:01 +0200 Subject: [PATCH 1/4] Creates symlinks in path to bin scripts --- kafka/Dockerfile | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/kafka/Dockerfile b/kafka/Dockerfile index 238a812..4d41aa6 100644 --- a/kafka/Dockerfile +++ b/kafka/Dockerfile @@ -21,5 +21,13 @@ RUN set -ex; \ WORKDIR /opt/kafka +RUN set -ex; \ + \ + bash -ec 'for F in /opt/kafka/bin/*.sh; do ln -sv $F /usr/local/bin/${F:15:-3}; done;' \ + rm /usr/local/bin/kafka-run-class; \ + sed -i 's|exec $(dirname $0)/kafka-run-class.sh |exec /opt/kafka/bin/kafka-run-class.sh |' /usr/local/bin/*; \ + \ + echo "TODO how do we handle log4j.properties" + COPY docker-help.sh /usr/local/bin/docker-help ENTRYPOINT ["docker-help"] From 5edcb9574bdb711b8034b700f201069b4956f3d8 Mon Sep 17 00:00:00 2001 From: Staffan Olsson Date: Wed, 26 Jul 2017 05:20:10 +0200 Subject: [PATCH 2/4] Fixes kafka-server-start etc --- kafka/Dockerfile | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/kafka/Dockerfile b/kafka/Dockerfile index 4d41aa6..4a0ced1 100644 --- a/kafka/Dockerfile +++ b/kafka/Dockerfile @@ -23,11 +23,13 @@ WORKDIR /opt/kafka RUN set -ex; \ \ - bash -ec 'for F in /opt/kafka/bin/*.sh; do ln -sv $F /usr/local/bin/${F:15:-3}; done;' \ + bash -ec 'for F in /opt/kafka/bin/*.sh; do cp -v $F /usr/local/bin/${F:15:-3}; done;' \ rm /usr/local/bin/kafka-run-class; \ sed -i 's|exec $(dirname $0)/kafka-run-class.sh |exec /opt/kafka/bin/kafka-run-class.sh |' /usr/local/bin/*; \ + sed -i 's|base_dir=$(dirname $0)|base_dir=/opt/kafka/bin|' /usr/local/bin/*; \ \ - echo "TODO how do we handle log4j.properties" + echo "TODO how do we handle log4j.properties"; \ + grep 'Dlog4j.configuration' /usr/local/bin/* /opt/kafka/bin/kafka-run-class.sh COPY docker-help.sh /usr/local/bin/docker-help ENTRYPOINT ["docker-help"] From 567d867d370f40170e82f1198ca992bdbb0fa4f4 Mon Sep 17 00:00:00 2001 From: Staffan Olsson Date: Wed, 26 Jul 2017 05:25:12 +0200 Subject: [PATCH 3/4] Lets you mount your config at /etc/kafka and get your *log4j.properties --- kafka/Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kafka/Dockerfile b/kafka/Dockerfile index 4a0ced1..98059a1 100644 --- a/kafka/Dockerfile +++ b/kafka/Dockerfile @@ -28,8 +28,8 @@ RUN set -ex; \ sed -i 's|exec $(dirname $0)/kafka-run-class.sh |exec /opt/kafka/bin/kafka-run-class.sh |' /usr/local/bin/*; \ sed -i 's|base_dir=$(dirname $0)|base_dir=/opt/kafka/bin|' /usr/local/bin/*; \ \ - echo "TODO how do we handle log4j.properties"; \ - grep 'Dlog4j.configuration' /usr/local/bin/* /opt/kafka/bin/kafka-run-class.sh + mv -v ./config /etc/kafka; \ + ln -sv /etc/kafka ./config; COPY docker-help.sh /usr/local/bin/docker-help ENTRYPOINT ["docker-help"] From 67b5deae600b0913607c6bccaa9d0cf58eb7e785 Mon Sep 17 00:00:00 2001 From: Staffan Olsson Date: Wed, 26 Jul 2017 05:38:32 +0200 Subject: [PATCH 4/4] How does a caller know how to override log4j.properties? --- kafka/Dockerfile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/kafka/Dockerfile b/kafka/Dockerfile index 98059a1..1daa0af 100644 --- a/kafka/Dockerfile +++ b/kafka/Dockerfile @@ -29,7 +29,10 @@ RUN set -ex; \ sed -i 's|base_dir=$(dirname $0)|base_dir=/opt/kafka/bin|' /usr/local/bin/*; \ \ mv -v ./config /etc/kafka; \ - ln -sv /etc/kafka ./config; + ln -sv /etc/kafka ./config; \ + \ + grep 'Dlog4j.configuration' /usr/local/bin/* /opt/kafka/bin/kafka-run-class.sh; + COPY docker-help.sh /usr/local/bin/docker-help ENTRYPOINT ["docker-help"]