forked from wurstmeister/kafka-docker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
60 lines (51 loc) · 2.24 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
FROM openjdk:11-jre-slim
ARG kafka_version=2.8.1
ARG scala_version=2.13
ARG vcs_ref=unspecified
ARG build_date=unspecified
LABEL org.label-schema.name="kafka" \
org.label-schema.description="Apache Kafka" \
org.label-schema.build-date="${build_date}" \
org.label-schema.vcs-url="https://github.com/wurstmeister/kafka-docker" \
org.label-schema.vcs-ref="${vcs_ref}" \
org.label-schema.version="${scala_version}_${kafka_version}" \
org.label-schema.schema-version="1.0" \
maintainer="wurstmeister"
ENV KAFKA_VERSION=$kafka_version \
SCALA_VERSION=$scala_version \
KAFKA_HOME=/opt/kafka
ENV PATH=${PATH}:${KAFKA_HOME}/bin
COPY download-kafka.sh start-kafka.sh broker-list.sh create-topics.sh versions.sh /tmp2/
RUN set -eux ; \
apt-get update ; \
apt-get upgrade -y ; \
apt-get install -y --no-install-recommends jq net-tools curl wget ; \
### BEGIN docker for CI tests
apt-get install -y --no-install-recommends gnupg lsb-release ; \
curl -fsSL https://download.docker.com/linux/debian/gpg | gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg ; \
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/debian \
$(lsb_release -cs) stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null ; \
apt-get update ; \
apt-get install -y --no-install-recommends docker-ce-cli ; \
apt remove -y gnupg lsb-release ; \
apt clean ; \
apt autoremove -y ; \
apt -f install ; \
### END docker for CI tests
### BEGIN other for CI tests
apt-get install -y --no-install-recommends netcat ; \
### END other for CI tests
chmod a+x /tmp2/*.sh ; \
mv /tmp2/start-kafka.sh /tmp2/broker-list.sh /tmp2/create-topics.sh /tmp2/versions.sh /usr/bin ; \
sync ; \
/tmp2/download-kafka.sh ; \
tar xfz /tmp2/kafka_${SCALA_VERSION}-${KAFKA_VERSION}.tgz -C /opt ; \
rm /tmp2/kafka_${SCALA_VERSION}-${KAFKA_VERSION}.tgz ; \
ln -s /opt/kafka_${SCALA_VERSION}-${KAFKA_VERSION} ${KAFKA_HOME} ; \
rm -rf /tmp2 ; \
rm -rf /var/lib/apt/lists/*
COPY overrides /opt/overrides
VOLUME ["/kafka"]
# Use "exec" form so that it runs as PID 1 (useful for graceful shutdown)
CMD ["start-kafka.sh"]