-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use base image Docker image with Kafka and build other images on top of it #20
Changes from all commits
6b326bc
f1daef4
e7f5e6b
02c2f94
dd79007
e92c95c
8608c0c
d31c62b
90dcff6
d3da249
560c4cc
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
FROM fedora:26 | ||
|
||
RUN dnf -y install java-1.8.0-openjdk gettext hostname && dnf clean all -y | ||
|
||
# set Kafka home folder | ||
ENV KAFKA_HOME=/opt/kafka | ||
|
||
# Add kafka group / user | ||
RUN groupadd -r -g 1001 kafka && useradd -r -m -u 1001 -g kafka kafka | ||
|
||
# Set Scala and Kafka version | ||
ENV SCALA_VERSION=2.11 | ||
ENV KAFKA_VERSION=0.11.0.1 | ||
|
||
# Set Kafka MD5checksum | ||
ENV CHECKSUM="3b15f06707e03d8bc5256cfc3b2413edeeabb28f1717aaea6a7ba0c97b91a2025ecc523729d12c59725354d913edd35118008a1fca918909dc33e13276c37c5c kafka_2.11-0.11.0.1.tgz" | ||
|
||
# Set from build args | ||
ARG version=latest | ||
ENV VERSION ${version} | ||
|
||
WORKDIR $KAFKA_HOME | ||
|
||
# downloading/extracting Apache Kafka | ||
RUN curl -O https://www.apache.org/dist/kafka/$KAFKA_VERSION/kafka_$SCALA_VERSION-$KAFKA_VERSION.tgz \ | ||
&& echo $CHECKSUM > kafka_$SCALA_VERSION-$KAFKA_VERSION.tgz.md5 \ | ||
&& sha512sum --check kafka_$SCALA_VERSION-$KAFKA_VERSION.tgz.md5 \ | ||
&& tar xvfz kafka_$SCALA_VERSION-$KAFKA_VERSION.tgz -C $KAFKA_HOME --strip-components=1 \ | ||
&& rm -f kafka_$SCALA_VERSION-$KAFKA_VERSION.tgz* |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
PROJECT_NAME=kafka-base | ||
|
||
include ../Makefile.common | ||
|
||
.PHONY: build clean |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,10 @@ | ||
FROM fedora:25 | ||
|
||
RUN dnf -y install which java-1.8.0-openjdk libaio python gettext hostname iputils wget && dnf clean all -y | ||
|
||
# set Scala and Kafka version | ||
ENV SCALA_VERSION=2.11 | ||
ENV KAFKA_VERSION=0.11.0.1 | ||
# set Kafka home folder | ||
ENV KAFKA_HOME=/opt/kafka | ||
|
||
# Set from build args | ||
ARG version=latest | ||
ENV VERSION ${version} | ||
|
||
# downloading/extracting Apache Kafka | ||
RUN wget http://www.eu.apache.org/dist/kafka/$KAFKA_VERSION/kafka_$SCALA_VERSION-$KAFKA_VERSION.tgz | ||
|
||
RUN mkdir $KAFKA_HOME \ | ||
&& tar xvfz kafka_$SCALA_VERSION-$KAFKA_VERSION.tgz -C $KAFKA_HOME --strip-components=1 \ | ||
&& mkdir $KAFKA_HOME/plugins | ||
|
||
WORKDIR $KAFKA_HOME | ||
FROM enmasseproject/kafka-base:latest | ||
|
||
EXPOSE 8083 | ||
|
||
# copy scripts for starting Kafka Connect | ||
COPY ./scripts/ $KAFKA_HOME | ||
|
||
USER kafka:kafka | ||
|
||
ENTRYPOINT ["/opt/kafka/kafka_connect_run.sh"] |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,10 @@ | ||
FROM fedora:25 | ||
FROM enmasseproject/kafka-base:latest | ||
|
||
RUN dnf -y install which java-1.8.0-openjdk libaio python gettext hostname iputils wget && dnf clean all -y | ||
EXPOSE 9092 | ||
|
||
# set Scala and Kafka version | ||
ENV SCALA_VERSION=2.11 | ||
ENV KAFKA_VERSION=0.11.0.0 | ||
# set Kafka home folder | ||
ENV KAFKA_HOME=/opt/kafka | ||
|
||
# Set from build args | ||
ARG version=latest | ||
ENV VERSION ${version} | ||
|
||
# downloading/extracting Apache Kafka | ||
RUN wget http://www.eu.apache.org/dist/kafka/$KAFKA_VERSION/kafka_$SCALA_VERSION-$KAFKA_VERSION.tgz | ||
|
||
RUN mkdir $KAFKA_HOME \ | ||
&& tar xvfz kafka_$SCALA_VERSION-$KAFKA_VERSION.tgz -C $KAFKA_HOME --strip-components=1 | ||
|
||
WORKDIR $KAFKA_HOME | ||
|
||
# copy template configuration files | ||
COPY ./config/zookeeper.properties.template $KAFKA_HOME/config/ | ||
# copy scripts for starting Kafka and Zookeeper | ||
COPY ./scripts/ $KAFKA_HOME | ||
|
||
USER kafka:kafka | ||
|
||
ENTRYPOINT ["/opt/kafka/kafka_run.sh"] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Genuine question: Why is it better to use a run script like this than put the command line in the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. My two cents ...
|
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,10 @@ | ||
FROM fedora:25 | ||
FROM enmasseproject/kafka-base:latest | ||
|
||
RUN dnf -y install which java-1.8.0-openjdk libaio python gettext hostname iputils wget && dnf clean all -y | ||
EXPOSE 9092 | ||
|
||
# set Scala and Kafka version | ||
ENV SCALA_VERSION=2.11 | ||
ENV KAFKA_VERSION=0.11.0.0 | ||
# set Kafka home folder | ||
ENV KAFKA_HOME=/opt/kafka | ||
|
||
# Set from build args | ||
ARG version=latest | ||
ENV VERSION ${version} | ||
|
||
# downloading/extracting Apache Kafka | ||
RUN wget http://www.eu.apache.org/dist/kafka/$KAFKA_VERSION/kafka_$SCALA_VERSION-$KAFKA_VERSION.tgz | ||
|
||
RUN mkdir $KAFKA_HOME \ | ||
&& tar xvfz kafka_$SCALA_VERSION-$KAFKA_VERSION.tgz -C $KAFKA_HOME --strip-components=1 | ||
# copy scripts for starting Kafka and Zookeeper | ||
COPY ./scripts/ $KAFKA_HOME | ||
|
||
WORKDIR $KAFKA_HOME | ||
USER kafka:kafka | ||
|
||
# copy template configuration files | ||
COPY ./config/zookeeper.properties.template $KAFKA_HOME/config/ | ||
# copy scripts for starting Kafka | ||
COPY ./scripts/ $KAFKA_HOME | ||
ENTRYPOINT ["/opt/kafka/kafka_run.sh"] |
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does anything actually read
LOG_DIR
? AFAICS, it's onlyKAFKA_LOG_DIRS
which is actually used.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This affects the logs (as in Log4j logs). Before I moved this to the /tmp directory Kafka Connect was complaining that it cannot create the logs directory in /opt/kafka (where the kafka user has no write access). This should stay there to avoid the error and should be removed with #21 once we stop logging to files.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, thanks. I noticed only after I commented that you'd mentioned this problem in the PR description.