Skip to content
This repository was archived by the owner on Mar 24, 2022. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion confluent-platform/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,15 @@ FROM debian:8.2
ENV SCALA_VERSION="2.10.4"
ENV JAVA_VERSION="7"
ENV CONFLUENT_MAJOR_VERSION="1.0"
ENV DOCKERIZE_VERSION="v0.2.0"

RUN apt-get update && \
apt-get upgrade -y && \
apt-get install -y curl openjdk-${JAVA_VERSION}-jre-headless && \
curl -SL http://packages.confluent.io/deb/${CONFLUENT_MAJOR_VERSION}/archive.key | apt-key add - && \
echo "deb [arch=all] http://packages.confluent.io/deb/${CONFLUENT_MAJOR_VERSION} stable main" >> /etc/apt/sources.list && \
apt-get update && \
apt-get install -y confluent-platform-${SCALA_VERSION}
apt-get install -y confluent-platform-${SCALA_VERSION} &&\
curl -o /tmp/dockerize.tar.gz -sSL "https://github.com/jwilder/dockerize/releases/download/${DOCKERIZE_VERSION}/dockerize-linux-amd64-${DOCKERIZE_VERSION}.tar.gz" &&\
tar -C /usr/local/bin -xzvf /tmp/dockerize.tar.gz &&\
rm -rf /tmp/dockerize.tar.gz
28 changes: 28 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
zookeeper:
image: confluent/zookeeper
ports:
- "2181"

schema-registry:
image: confluent/schema-registry
ports:
- "8081:8081"
links:
- zookeeper
- kafka

rest-proxy:
image: confluent/rest-proxy
ports:
- "8082:8082"
links:
- zookeeper
- kafka
- schema-registry

kafka:
image: confluent/kafka
ports:
- "9092:9092"
links:
- zookeeper
3 changes: 3 additions & 0 deletions kafka/kafka-docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ kafka_cfg_file="/etc/kafka/server.properties"
: ${KAFKA_ZOOKEEPER_CONNECTION_TIMEOUT_MS:=6000}
: ${KAFKA_AUTO_CREATE_TOPICS_ENABLE:=true}
: ${KAFKA_DELETE_TOPIC_ENABLE:=true}
: ${ZOOKEEPER_PORT=tcp://$KAFKA_ZOOKEEPER_CONNECT}

export KAFKA_BROKER_ID
export KAFKA_PORT
Expand Down Expand Up @@ -59,4 +60,6 @@ done

export KAFKA_LOG4J_OPTS="-Dlog4j.configuration=file:/etc/kafka/log4j.properties"

dockerize -wait $ZOOKEEPER_PORT

exec /usr/bin/kafka-server-start ${kafka_cfg_file}
5 changes: 5 additions & 0 deletions rest-proxy/rest-proxy-docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ rp_cfg_file="/etc/kafka-rest/kafka-rest.properties"
: ${RP_SCHEMA_REGISTRY_URL:=http://$SCHEMA_REGISTRY_PORT_8081_TCP_ADDR:$SCHEMA_REGISTRY_PORT_8081_TCP_PORT}
: ${RP_ZOOKEEPER_CONNECT:=$ZOOKEEPER_PORT_2181_TCP_ADDR:$ZOOKEEPER_PORT_2181_TCP_PORT}
: ${RP_DEBUG:=false}
: ${SCHEMA_REGISTRY_PORT:=$RP_SCHEMA_REGISTRY_URL}
: ${KAFKA_PORT:=tcp://$KAFKA_PORT_9092_TCP_ADDR:$KAFKA_PORT_9092_TCP_PORT}
: ${ZOOKEEPER_PORT:=tcp://$RP_ZOOKEEPER_CONNECT}

export RP_ID
export RP_PORT
Expand Down Expand Up @@ -34,4 +37,6 @@ done
# Fix for issue #77, PR #78: https://github.com/confluentinc/kafka-rest/pull/78/files
sed -i 's/\"kafka\"//' /usr/bin/kafka-rest-run-class

dockerize -wait $SCHEMA_REGISTRY_PORT -wait $KAFKA_PORT -wait $ZOOKEEPER_PORT

exec /usr/bin/kafka-rest-start ${rp_cfg_file}
4 changes: 4 additions & 0 deletions schema-registry/schema-registry-docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ sr_cfg_file="/etc/schema-registry/schema-registry.properties"
: ${SCHEMA_REGISTRY_KAFKASTORE_TOPIC:=_schemas}
: ${SCHEMA_REGISTRY_KAFKASTORE_CONNECTION_URL:=$ZOOKEEPER_PORT_2181_TCP_ADDR:$ZOOKEEPER_PORT_2181_TCP_PORT}
: ${SCHEMA_REGISTRY_DEBUG:=false}
: ${KAFKA_PORT:=tcp://$KAFKA_PORT_9092_TCP_ADDR:$KAFKA_PORT_9092_TCP_PORT}
: ${ZOOKEEPER_PORT:=tcp://$SCHEMA_REGISTRY_KAFKASTORE_CONNECTION_URL}

export SCHEMA_REGISTRY_PORT
export SCHEMA_REGISTRY_KAFKASTORE_TOPIC
Expand All @@ -29,4 +31,6 @@ for var in $(env | grep '^SCHEMA_REGISTRY_' | sort); do
echo "${key}=${value}" >> ${sr_cfg_file}
done

dockerize -wait $ZOOKEEPER_PORT -wait $KAFKA_PORT

exec /usr/bin/schema-registry-start ${sr_cfg_file}