-
Notifications
You must be signed in to change notification settings - Fork 3
/
Dockerfile
68 lines (44 loc) · 1.18 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
FROM ubuntu:20.04
# activate debian non interactiv mode
ARG DEBIAN_FRONTEND=noninteractive
# set locale info
ENV TZ=Europe/Berlin
RUN apt-get update
RUN apt-get upgrade -y
RUN apt-get install locales -y
# Java
RUN apt-get install default-jre -y
# tools
RUN apt-get install wget -y
# diagnostic tools
RUN apt-get install telnet -y
RUN apt-get install kafkacat -y
# user / home and working directory
RUN chmod 1777 /tmp
RUN useradd docker \
&& mkdir /home/docker \
&& chown docker:docker /home/docker \
&& addgroup docker staff
# switch directory
WORKDIR /home/docker
# startup script
ADD ./docker/start.sh ./
RUN chown root:docker ./start.sh
RUN chmod 770 ./start.sh
# switch user
USER docker
# Kafka
RUN wget https://ftp-stud.hs-esslingen.de/pub/Mirrors/ftp.apache.org/dist/kafka/2.6.0/kafka_2.13-2.6.0.tgz
RUN mkdir kafka
RUN tar -xzf kafka*.tgz --directory ./kafka --strip-components=1
RUN tar -xzf kafka*.tgz
RUN rm kafka*.tgz
# Kafka config
ADD ./docker/server.properties ./kafka/config/server.properties
# Tools
ADD ./docker/.bashrc ./.bashrc
ADD ./docker/kafka_messages.txt ./
ADD ./docker/test_500_000.txt ./
# starting up services
EXPOSE 9092 2181
CMD ./start.sh && bash