-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
54 lines (39 loc) · 1.61 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
51
52
53
FROM ubuntu:16.04
MAINTAINER Guy Fawkes <[email protected]>
ENV KAFKA_VERSION=0.11.0.0 KAFKA_SCALA_VERSION=2.11 JMX_PORT=7203
ENV KAFKA_RELEASE_ARCHIVE kafka_${KAFKA_SCALA_VERSION}-${KAFKA_VERSION}.tgz
RUN mkdir /kafka /data /logs
RUN apt update
RUN DEBIAN_FRONTEND=noninteractive apt -y install python-software-properties
RUN DEBIAN_FRONTEND=noninteractive apt -y install software-properties-common
RUN DEBIAN_FRONTEND=noninteractive apt -y install git
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y ca-certificates
RUN apt-get clean
RUN \
echo oracle-java8-installer shared/accepted-oracle-license-v1-1 select true | debconf-set-selections && \
add-apt-repository -y ppa:webupd8team/java && \
apt-get update && \
apt-get install -y oracle-java8-installer && \
rm -rf /var/lib/apt/lists/* && \
rm -rf /var/cache/oracle-jdk8-installer
ENV JAVA_HOME /usr/lib/jvm/java-8-oracle
# Download Kafka binary distribution
ADD http://www.us.apache.org/dist/kafka/${KAFKA_VERSION}/${KAFKA_RELEASE_ARCHIVE} /tmp/
ADD https://dist.apache.org/repos/dist/release/kafka/${KAFKA_VERSION}/${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 config /kafka/config
ADD start.sh /start.sh
# Set up a user to run Kafka
ENV PATH /kafka/bin:$PATH
WORKDIR /kafka
# broker, jmx
EXPOSE 9092 ${JMX_PORT}
VOLUME [ "/data", "/logs", "/kafka" ]
CMD ["/start.sh"]