-
Notifications
You must be signed in to change notification settings - Fork 4
/
Dockerfile
34 lines (24 loc) · 1.2 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
FROM ubuntu
WORKDIR /
RUN apt-get update > /dev/null && apt-get install runit -y > /dev/null
RUN apt-get update > /dev/null && apt-get install libssl-dev openssl -y > /dev/null
RUN apt-get update > /dev/null && apt-get install openjdk-8-jdk -y > /dev/null
ADD https://mirrors.estointernet.in/apache/kafka/2.5.0/kafka_2.12-2.5.0.tgz .
RUN tar xzf kafka_2.12-2.5.0.tgz && rm kafka_2.12-2.5.0.tgz
RUN mkdir -p /etc/service/zookeeper/
RUN mkdir -p /etc/service/kafka/
COPY serverssl.properties .
COPY prepStartup.sh .
RUN /bin/bash -c "echo -e '#!/bin/bash\nexec /kafka_2.12-2.5.0/bin/zookeeper-server-start.sh /kafka_2.12-2.5.0/config/zookeeper.properties \n' > /etc/service/zookeeper/run"
RUN /bin/bash -c "echo -e '#!/bin/bash\n/prepStartup.sh\nexec /kafka_2.12-2.5.0/bin/kafka-server-start.sh /kafka_2.12-2.5.0/config/serverssl.properties \n' > /etc/service/kafka/run"
RUN chmod +x /etc/service/zookeeper/run
RUN chmod +x /etc/service/kafka/run
ENV KAFKA_HOME=/kafka_2.12-2.5.0
ENV PASSWORD=password
ENV DOMAIN=www.pardhu.com
EXPOSE 2181/tcp
EXPOSE 9093/tcp
EXPOSE 9094/tcp
HEALTHCHECK --interval=60s --timeout=5s --start-period=30s \
CMD [[ $(sv status kafka) =~ "run" ]] || exit 1
CMD ["runsvdir", "/etc/service"]