• This repository has been archived on 25/Mar/2022
  • Stars
    star
    116
  • Rank 301,561 (Top 6 %)
  • Language
    Shell
  • Created over 9 years ago
  • Updated over 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

DEPRECATED - Dockerfiles for Confluent Stream Data Platform

Confluent Stream Data Platform on Docker (DEPRECATED)

Note: These images are no longer being updated. Confluent's versions of Docker images for Confluent Platform may be found here.

Experimental docker images for running the Confluent Platform. These images are currently intended for development use, not for production use.

Quickstart

The Docker version of the Confluent Quickstart looks like this:

# Start Zookeeper and expose port 2181 for use by the host machine
docker run -d --name zookeeper -p 2181:2181 confluent/zookeeper

# Start Kafka and expose port 9092 for use by the host machine
docker run -d --name kafka -p 9092:9092 --link zookeeper:zookeeper confluent/kafka

# Start Schema Registry and expose port 8081 for use by the host machine
docker run -d --name schema-registry -p 8081:8081 --link zookeeper:zookeeper \
    --link kafka:kafka confluent/schema-registry

# Start REST Proxy and expose port 8082 for use by the host machine
docker run -d --name rest-proxy -p 8082:8082 --link zookeeper:zookeeper \
    --link kafka:kafka --link schema-registry:schema-registry confluent/rest-proxy

If you're using boot2docker, you'll need to adjust how you run Kafka:

# Get the IP address of the docker machine
DOCKER_MACHINE=`boot2docker ip`

# Start Kafka and expose port 9092 for use by the host machine
# Also configure the broker to use the docker machine's IP address
docker run -d --name kafka -p 9092:9092 --link zookeeper:zookeeper \
    --env KAFKA_ADVERTISED_HOST_NAME=$DOCKER_MACHINE confluent/kafka

If all goes well when you run the quickstart, docker ps should give you something that looks like this:

CONTAINER ID        IMAGE                              COMMAND                  CREATED             STATUS              PORTS                    NAMES
7fc453ca701c        confluent/rest-proxy               "/usr/local/bin/rest-"   2 minutes ago       Up 2 minutes        0.0.0.0:8082->8082/tcp   rest-proxy
4d33d52a98bd        confluent/schema-registry:latest   "/usr/local/bin/schem"   2 minutes ago       Up 2 minutes        0.0.0.0:8081->8081/tcp   schema-registry     
d9613d3bc37d        confluent/kafka:latest             "/usr/local/bin/kafka"   2 minutes ago       Up 2 minutes        0.0.0.0:9092->9092/tcp   kafka               
459afcb7dfcf        confluent/zookeeper:latest         "/usr/local/bin/zk-do"   2 minutes ago       Up 2 minutes        0.0.0.0:2181->2181/tcp   zookeeper           

Running on Multiple Remote Hosts and Clustering

To run across multiple hosts you will need some way of communicating between Docker hosts so all remote containers can see each other. This is typically done via some sort of service discovery mechanism (so containers/services can find each other) and/or SDN (so containers can communicate) such as weave or flannel as SDN examples. Having that in place, you can use environment variables to specify the IP/hostname and respective ports for the remote containers and forgo the use of --link. For example to make a 3-node Zookeeper ensemble, each running on separate Docker hosts (zk-1:172.16.42.101, zk-2:172.16.42.102, and zk-3:172.16.42.103), and have a remote Kafka 2-node cluster connection:

docker run --name zk-1 -e zk_id=1 -e zk_server.1=172.16.42.101:2888:3888 -e zk_server.2=172.16.42.102:2888:3888 -e zk_server.3=172.16.42.103:2888:3888 -p 2181:2181 -p 2888:2888 -p 3888:3888 confluent/zookeeper
docker run --name zk-2 -e zk_id=2 -e zk_server.1=172.16.42.101:2888:3888 -e zk_server.2=172.16.42.102:2888:3888 -e zk_server.3=172.16.42.103:2888:3888 -p 2181:2181 -p 2888:2888 -p 3888:3888 confluent/zookeeper
docker run --name zk-3 -e zk_id=3 -e zk_server.1=172.16.42.101:2888:3888 -e zk_server.2=172.16.42.102:2888:3888 -e zk_server.3=172.16.42.103:2888:3888 -p 2181:2181 -p 2888:2888 -p 3888:3888 confluent/zookeeper
docker run --name kafka-1 -e KAFKA_BROKER_ID=1 -e KAFKA_ZOOKEEPER_CONNECT=172.16.42.101:2181,172.16.42.102:2181,172.16.42.103:2181 -p 9092:9092 confluent/kafka
docker run --name kafka-2 -e KAFKA_BROKER_ID=2 -e KAFKA_ZOOKEEPER_CONNECT=172.16.42.101:2181,172.16.42.102:2181,172.16.42.103:2181 -p 9092:9092 confluent/kafka

Changing settings

The images support using environment variables via the Docker -e | --env flags for setting various settings in the respective images. For example:

  • For the Zookeeper image use variables prefixed with ZOOKEEPER_ with the variables expressed exactly as how they would appear in the zookeeper.properties file. As an example, to set syncLimit and server.1 you'd run docker run --name zk -e ZOOKEEPER_syncLimit=2 -e ZOOKEEPER__server.1=localhost:2888:3888 confluent/zookeeper.

  • For the Kafka image use variables prefixed with KAFKA_ with an underscore (_) separating each word instead of periods. As an example, to set broker.id and offsets.storage you'd run docker run --name kafka --link zookeeper:zookeeper -e KAFKA_BROKER_ID=2 -e KAFKA_OFFSETS_STORAGE=kafka confluent/kafka.

  • For the Schema Registry image use variables prefixed with SCHEMA_REGISTRY_ with an underscore (_) separating each word instead of periods. As an example, to set kafkastore.topic and debug you'd run docker run --name schema-registry --link zookeeper:zookeeer --link kafka:kafka -e SCHEMA_REGISTRY_KAFKASTORE_TOPIC=_schemas -e SCHEMA_REGISTRY_DEBUG=true confluent/schema-registry.

  • For the Kafka REST Proxy image use variables prefixed with REST_PROXY_ with an underscore (_) separating each word instead of periods. As an example, to set id and zookeeper_connect you'd run docker run --name rest-proxy --link schema-registry:schema-registry --link zookeeper:zookeeer -e REST_PROXY_ID=2 -e REST_PROXY_ZOOKEEPER_CONNECT=192.168.1.101:2182 confluent/rest-proxy.

You can also download your own file, with similar variable substitution as shown above. To download your own file use the prefixes as shown above, with the special variable CFG_URL appended. For example, to download your own ZK configuration file and leverage the ZOOKEEPER_ variable substitution you could do docker run --name zk -e ZOOKEEPER_CFG_URL=http://myurl/zookeeper.properties ZOOKEEPER_id=1 -e ZOOKEEPER_maxClientCnxns=20 confluent/zookeeper.

Potential Caveats

Running Kafka in Docker does have some potential Caveats.

  • Cluster metadata will use the advertised.listeners configuration setting. This defaults to the hostname of the machine it's running in.

  • NAT networking requires proper advertisement of the host endpoints. This requires a 1 to 1 port mapping such as -p 9092:9092, changing the advertised.listeners to match the docker port mapping, or --net=host. Using host networking is recommended.

Docker Compose

The examples/fullstack directory contains a Docker compose script with a full Confluent stack. This include Zookeeper, a Kafka Broker, the rest proxy, and the schema registry.

Setup your environment

This command will create a docker machine called confluent with a hostname of confluent. Note you can change the driver to whatever virtualization platform you currently use.

docker-machine create --driver virtualbox confluent

This command will setup your shell to use the confluent virtual machine as your docker host.

eval $(docker-machine env confluent)

Local Host entries

A Kafka broker advertises the hostname of the machine it's running on. This requires the hostname to be resolvable on the client machine. You will need to add a host entry for your docker machine to your hosts file.

The command docker-machine ip <machine name> will return the ip address of your docker machine.

> docker-machine ip confluent
192.168.99.100

Edit your hosts file and add a host entry for the docker machine.

192.168.99.100  confluent

Launch Images

cd examples/fullstack
docker-compose up

Connecting

Now all of your services will be available at the host confluent.

Building Images

For convenience, a build.sh script is provided to build all variants of images. This includes:

  • confluent-platform - Confluent Platform base images, with all Confluent Platform packages installed. There are separate images for each Scala version. These images are tagged as confluent/platform-$SCALA_VERSION, with the default (2.10.4) also tagged as confluent/platform.
  • confluent/zookeeper - starts Zookeeper on port 2181.
  • confluent/kafka - starts Kafka on 9092.
  • confluent/schema-registry - starts the Schema Registry on 8081.
  • confluent/rest-proxy - starts the Kafka REST Proxy on 8082.
  • confluent-tools - provides tools with a few links to other containers for commonly used tools.

Note that all services are built only using the default Scala version. When run as services, the Scala version should not matter. If you need a specific Scala version, use the corresponding confluent/platform-$SCALA_VERSION image as your FROM line in your derived Dockerfile.

A second script, push.sh, will push the generated images to Docker Hub. First you'll need to be logged in:

docker login --username=yourhubusername --password=yourpassword [email protected]

then execute the script.

More Repositories

1

librdkafka

The Apache Kafka C/C++ library
C
7,353
star
2

ksql

The database purpose-built for stream processing applications.
Java
5,533
star
3

confluent-kafka-go

Confluent's Apache Kafka Golang client
Go
4,402
star
4

confluent-kafka-python

Confluent's Kafka Python Client
Python
3,388
star
5

confluent-kafka-dotnet

Confluent's Apache Kafka .NET client
C#
2,560
star
6

kafka-streams-examples

Demo applications and code examples for Apache Kafka's Streams API.
Java
2,169
star
7

kafka-rest

Confluent REST Proxy for Kafka
Java
2,137
star
8

schema-registry

Confluent Schema Registry for Kafka
Java
2,022
star
9

examples

Apache Kafka and Confluent Platform examples and demos
Shell
1,878
star
10

bottledwater-pg

Change data capture from PostgreSQL into Kafka
C
1,521
star
11

demo-scene

๐Ÿ‘พScripts and samples to support Confluent Demos and Talks. โš ๏ธMight be rough around the edges ;-) ๐Ÿ‘‰For automated tutorials and QA'd code, see https://github.com/confluentinc/examples/
Shell
1,356
star
12

cp-docker-images

[DEPRECATED] Docker images for Confluent Platform.
Python
1,143
star
13

kafka-connect-jdbc

Kafka Connect connector for JDBC-compatible databases
Java
953
star
14

cp-all-in-one

docker-compose.yml files for cp-all-in-one , cp-all-in-one-community, cp-all-in-one-cloud, Apache Kafka Confluent Platform
Python
889
star
15

cp-helm-charts

The Confluent Platform Helm charts enable you to deploy Confluent Platform services on Kubernetes for development, test, and proof of concept environments.
Mustache
764
star
16

kafka-connect-elasticsearch

Kafka Connect Elasticsearch connector
Java
715
star
17

parallel-consumer

Parallel Apache Kafka client wrapper with per message ACK, client side queueing, a simpler consumer/producer API with key concurrency and extendable non-blocking IO processing.
Java
654
star
18

kafka-connect-hdfs

Kafka Connect HDFS connector
Java
465
star
19

kafka-tutorials

Tutorials and Recipes for Apache Kafka
Java
302
star
20

kafka-images

Confluent Docker images for Apache Kafka
Python
295
star
21

ducktape

System integration and performance tests
Python
294
star
22

kafka-rest-node

Node.js client for the Kafka REST proxy
JavaScript
146
star
23

confluent-platform-security-tools

Security tools for the Confluent Platform.
Shell
146
star
24

kafka-connect-datagen

Connector that generates data for demos
Java
143
star
25

rest-utils

Utilities and a small framework for building REST services with Jersey, Jackson, and Jetty.
Java
111
star
26

cli

CLI for Confluent Cloud and Confluent Platform
Go
103
star
27

openmessaging-benchmark

Java
89
star
28

camus

Mirror of Linkedin's Camus
Java
88
star
29

common

Common utilities library containing metrics, config and utils
Java
85
star
30

kafka-workshop

JavaScript
75
star
31

training-developer-src

Source Code accompanying the Confluent Kafka for Developers course
Java
70
star
32

ccloud-tools

Running Tools from Confluent Platform along with your Confluent Cloudโ„ข Cluster
HCL
67
star
33

bincover

Easily measure code coverage of Golang binaries
Go
62
star
34

libserdes

Avro Serialization/Deserialization C/C++ library with Confluent schema-registry support
C
62
star
35

kafka-connect-blog

Demo for Kafka Connect with JDBC and HDFS Connectors
Shell
59
star
36

confluent-cli

Confluent Platform CLI
Shell
58
star
37

ksqldb-graphql

Node.js GraphQL integration for ksqlDB
TypeScript
56
star
38

terraform-provider-confluentcloud

Confluent Cloud Terraform Provider is deprecated in favor of Confluent Terraform Provider
Go
52
star
39

confluent-sigma

JavaScript
50
star
40

jmx-monitoring-stacks

๐Ÿ“Š Monitoring examples for Confluent Cloud and Confluent Platform
C#
44
star
41

qcon-microservices

Example online orders app composed of event-driven microservices. Built for QCon workshop.
Java
38
star
42

securing-kafka-blog

Secure Kafka cluster (in a VM) for development and testing
Puppet
38
star
43

training-administration-src

Contains docker-compose file needed for Apache Kafka Administration by Confluent training
HTML
36
star
44

mox

A hybrid mock and proxy server - easily programmable and runs on express
JavaScript
35
star
45

terraform-state-s3

Terraform module to create the S3/DynamoDB backend to store the Terraform state+lock
HCL
34
star
46

common-docker

Confluent Commons with support for building and testing Docker images.
Java
34
star
47

ksql-recipes-try-it-at-home

Files needed to try out KSQL Recipes for yourself
Shell
34
star
48

cp-demo

Confluent Platform Demo including Apache Kafka, ksqlDB, Control Center, Schema Registry, Security, Schema Linking, and Cluster Linking
Shell
31
star
49

confluent-kubernetes-examples

Example scenario workflows for Confluent for Kubernetes
Shell
31
star
50

training-ksql-and-streams-src

Sample solutions for the exercises of the course KSQL & Kafka Streams
Java
30
star
51

schema-registry-images

Docker Images for Schema Registry
Python
29
star
52

confluent-docker-utils

Common Python utils for testing Confluent's Docker images
Python
28
star
53

cp-ansible

Ansible playbooks for the Confluent Platform
Jinja
28
star
54

ksql-images

KSQL platform docker images
Shell
27
star
55

proto-go-setter

Go
23
star
56

coding-in-motion

Source code for the "Coding in Motion" series.
Nix
23
star
57

online-inferencing-blog-application

Source code and application accompanying the online inferencing blog
Java
21
star
58

stream-me-up-scotty

A wide range of Digital Assets from Confluent's Solution Engineering team for Confluent Cloud
21
star
59

terraform-provider-confluent

Terraform Provider for Confluent
Go
21
star
60

training-fundamentals-src

Source code accompanying the course "Apache Kafka Technical Essentials"
Shell
19
star
61

infoq-kafka-ksql

Code samples to go with InfoQ article
Shell
17
star
62

kafka-rest-images

Docker Images for Kafka REST
Python
17
star
63

flink-cookbook

Java
17
star
64

confluent-kafka-javascript

Confluent's Apache Kafka JavaScript client
JavaScript
17
star
65

kafka-mqtt-images

Confluent Docker images for Kafka MQTT
Shell
16
star
66

demo-realtime-data-warehousing

Streaming data pipelines for real-time data warehousing. Includes fully managed connectors (PostgreSQL CDC, Snowflake).
HCL
14
star
67

training-cao-src

Source code accompanying the course "Monitoring, Troubleshooting and Tuning"
Java
13
star
68

event-streaming-patterns

A collection of Event Streaming Patterns, including problem statements, solutions, and implementation examples.
HTML
13
star
69

ccloud-connectivity

Setup and testing connectivity to Confluent Cloud
Shell
13
star
70

learn-building-flink-applications-in-java-exercises

Java
13
star
71

ksqldb-recipes

Makefile
11
star
72

ksql-workshop

KSQL Workshop
11
star
73

control-center-images

Docker images for enterprise control center images
Python
11
star
74

kafka-connect-http-demo

A demo target for running the Confluent HTTP sink connector
Java
11
star
75

castle

Castle is a test harness for Apache Kafka, Trogdor, and related projects.
Java
11
star
76

kafkacat-images

Docker Images for Kafkacat
10
star
77

demo-stream-designer

Current 2022 Confluent Keynote Demo covering Stream Designer, Stream Catalog, and Stream Sharing.
Python
10
star
78

confluent-kafka-go-dev

[EXPERIMENTAL] Development / WIP / exploratory / test fork of confluent-kafka-go
Go
10
star
79

demo-change-data-capture

This demo shows how to capture data changes from relational databases (Oracle and PostgreSQL) and stream them to Confluent Cloud, use ksqlDB for real-time stream processing, send enriched data to cloud data warehouses (Snowflake and Amazon Redshift).
HCL
10
star
80

confluent-hybrid-cloud-workshop

Confluent Hybrid Cloud Workshop
HCL
10
star
81

commercial-workshops

Confluent Commercial SE Team's Demo and Workshop Repository
Python
9
star
82

learn-kafka-courses

Learn the basics of Apache Kafkaยฎ from leaders in the Kafka community with these video courses covering the Kafka ecosystem and hands-on exercises.
Shell
9
star
83

hackathons

Contains skeleton projects for hackathons.
Python
8
star
84

ksql-elasticsearch-demo

TSQL
8
star
85

learn-practical-event-modeling

Kotlin
8
star
86

strata-tutorials

Content for Spring 2016 Strata tutorials
Java
7
star
87

learn-apache-kafka-for-dotnet-developers-exercises

C#
7
star
88

confluent-oauth-extensions

Java
6
star
89

kafka-replicator-images

Docker images for Kafka Connect
Shell
6
star
90

etl

Code for ETL data pipelines
Python
6
star
91

operator-earlyaccess

Confluent Operator Early Access docs
6
star
92

schema-registry-workshop

JavaScript
6
star
93

support-metrics-common

Common utilities for metrics collection of proactive support
Java
6
star
94

confluent-kafka-go-example

Example application using the confluent-kafka-go client
Go
5
star
95

streaming-ops

Simulated production environment running Kubernetes targeting Apache Kafka and Confluent components on Confluent Cloud. Managed by declarative infrastructure and GitOps.
Shell
5
star
96

learn-kafka-connect

Shell
4
star
97

support-metrics-client

The client application that powers metrics collection for pro-active support
Java
4
star
98

avro-cpp-packaging

Avro C++ library packaging
C++
4
star
99

aws-confluent

Public repository for Confluent on AWS related material.
4
star
100

qcon-ai-workshop

Exercises for QCon Workshop
JavaScript
4
star