-
Notifications
You must be signed in to change notification settings - Fork 5
/
Dockerfile
50 lines (37 loc) · 1.39 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# Dockerfile for running a Kafka ensemble (primarily in Kubernetes)
# - Apache Kafka 0.8.1.1 from binary distribution.
# - Oracle Java 7 and a base of Ubuntu 12.04, currently.
#
FROM relateiq/oracle-java7
MAINTAINER Graeme Johnson <graeme@johnson-family.ca>
RUN \
mkdir /kafka /data /logs && \
apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y ca-certificates
ENV KAFKA_RELEASE_ARCHIVE kafka_2.10-0.8.1.1.tgz
# Download Kafka binary distribution
ADD http://www.us.apache.org/dist/kafka/0.8.1.1/${KAFKA_RELEASE_ARCHIVE} /tmp/
ADD https://dist.apache.org/repos/dist/release/kafka/0.8.1.1/${KAFKA_RELEASE_ARCHIVE}.md5 /tmp/
WORKDIR /tmp
# Check artifact digest integrity
RUN echo VERIFY CHECKSUM: && \
gpg --print-md MD5 ${KAFKA_RELEASE_ARCHIVE} 2>/dev/null && \
cat ${KAFKA_RELEASE_ARCHIVE}.md5
# Install Kafka to /kafka
RUN tar -zx -C /kafka --strip-components=1 -f ${KAFKA_RELEASE_ARCHIVE} && \
rm -rf kafka_*
ADD http://repo1.maven.org/maven2/org/slf4j/slf4j-log4j12/1.7.6/slf4j-log4j12-1.7.6.jar /kafka/libs/
ADD config /kafka/config
ADD config-and-run.sh /kafka/
# Set up a user to run Kafka
RUN groupadd kafka && \
useradd -d /kafka -g kafka -s /bin/false kafka && \
chown -R kafka:kafka /kafka /data /logs
USER kafka
ENV PATH /kafka/bin:$PATH
WORKDIR /kafka
# primary, jmx
EXPOSE 9092 7203
VOLUME [ "/data", "/logs" ]
ENTRYPOINT ["/kafka/config-and-run.sh"]
CMD [""]