mirror of
https://github.com/newnius/Dockerfiles.git
synced 2025-06-07 00:21:56 +00:00
add kafka
This commit is contained in:
parent
1850828acf
commit
144c95a233
20
kafka/2.1.0/Dockerfile
Normal file
20
kafka/2.1.0/Dockerfile
Normal file
@ -0,0 +1,20 @@
|
||||
FROM openjdk:8-jre-alpine
|
||||
|
||||
MAINTAINER Newnius <newnius.cn@gmail.com>
|
||||
|
||||
# Prerequisites
|
||||
RUN apk add --no-cache bash
|
||||
|
||||
# Install Kafka
|
||||
RUN wget -O kafka.tgz http://us.mirrors.quenda.co/apache/kafka/2.1.0/kafka_2.11-2.1.0.tgz && \
|
||||
tar -xzf kafka.taz -C /usr/local/ && rm kafka.tgz
|
||||
|
||||
RUN ln -s /usr/local/kafka_2.11-2.1.0 /usr/local/kafka
|
||||
|
||||
ENV KAFKA_HOME /usr/local/kafka
|
||||
|
||||
WORKDIR $KAFKA_HOME
|
||||
|
||||
ADD start_kafka.sh /etc/start_kafka.sh
|
||||
|
||||
CMD ["/etc/start_kafka.sh"]
|
12
kafka/2.1.0/README.md
Normal file
12
kafka/2.1.0/README.md
Normal file
@ -0,0 +1,12 @@
|
||||
TBD
|
||||
|
||||
```bash
|
||||
docker service create \
|
||||
--name kafka \
|
||||
--hostname=kafka \
|
||||
--network swarm-net \
|
||||
--detach=true \
|
||||
--replicas 1 \
|
||||
--endpoint-mode dnsrr \
|
||||
newnius/kafka:2.1.0
|
||||
```
|
10
kafka/2.1.0/start_kafka.sh
Executable file
10
kafka/2.1.0/start_kafka.sh
Executable file
@ -0,0 +1,10 @@
|
||||
#!/bin/bash
|
||||
|
||||
## Overide default configuration files
|
||||
: ${EXTRA_CONF_DIR:=/config/kafka}
|
||||
|
||||
if [ -d "$EXTRA_CONF_DIR" ]; then
|
||||
cp $EXTRA_CONF_DIR/* /usr/local/kafka/config
|
||||
fi
|
||||
|
||||
bash /usr/local/kafka/bin/kafka-server-start.sh /usr/local/kafka/config/server.properties
|
Loading…
Reference in New Issue
Block a user