-
Notifications
You must be signed in to change notification settings - Fork 130
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from Landoop/docker
Add docker image for running Connect UI easily.
- Loading branch information
Showing
4 changed files
with
91 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
0.0.0.0:8000 | ||
tls off | ||
|
||
root /kafka-connect-ui | ||
log /access.log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
FROM alpine | ||
MAINTAINER Marios Andreopoulos <marios@landoop.com> | ||
|
||
WORKDIR / | ||
# Add needed tools | ||
RUN apk add --no-cache ca-certificates wget \ | ||
&& echo "progress = dot:giga" | tee /etc/wgetrc | ||
|
||
# Add and Setup Caddy webserver | ||
RUN wget "https://caddyserver.com/download/build?os=linux&arch=amd64&features=" -O /caddy.tgz \ | ||
&& mkdir caddy \ | ||
&& tar xzf caddy.tgz -C /caddy \ | ||
&& rm -f /caddy.tgz | ||
|
||
# Add and Setup Kafka-Connect-Ui | ||
ARG CONNECT_UI_URL=https://github.com/Landoop/kafka-connect-ui/releases/download/v0.8.0/kafka-connect-ui-0.8.0.tar.gz | ||
RUN wget "${CONNECT_UI_URL}" -O /kafka-connect-ui.tar.gz \ | ||
&& mkdir /kafka-connect-ui \ | ||
&& tar xzf /kafka-connect-ui.tar.gz -C /kafka-connect-ui \ | ||
&& rm -f /kafka-connect-ui.tar.gz | ||
|
||
# Add configuration and runtime files | ||
ADD Caddyfile /caddy/ | ||
ADD run.sh / | ||
RUN chmod +x /run.sh | ||
|
||
EXPOSE 8000 | ||
ENTRYPOINT ["/run.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
## Kafka Connect UI ## | ||
|
||
[![](https://images.microbadger.com/badges/image/landoop/kafka-connect-ui.svg)](http://microbadger.com/images/landoop/kafka-connect-ui) | ||
|
||
This is a small docker image for Landoop's kafka-connect-ui. | ||
It serves the kafka-connect-ui from port 8000. | ||
A live version can be found at <https://kafka-connect-ui.landoop.com> | ||
|
||
The software is stateless and the only necessary option is your Kafka Connect | ||
URL: | ||
|
||
docker run --rm -it -p 8000:8000 \ | ||
-e "CONNECT_URL=http://connect.distributed.url" \ | ||
landoop/kafka-topics-ui | ||
|
||
Visit http://localhost:8000 to see the UI. | ||
|
||
Please note that because Connect does not send CORS headers, we have to proxy | ||
it. What this means for you, is that Connect, while running the container, is | ||
accessible via `http://your.address:8000/api/kafka-connect`. If this is a | ||
security issue for you, you should protect your machine via a firewall, or maybe | ||
do not expose the port and use the container's IP address to access the UI. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#!/bin/sh | ||
|
||
CONNECT_PROXY=/api/kafka-connect | ||
|
||
if [[ -z "$CONNECT_URL" ]]; then | ||
echo "Kafka Connect URL was not set via CONNECT_URL environment variable." | ||
echo "We will fall back to default http://localhost:8083 which probably won't work." | ||
# We also change connect proxy in order to make it as visible as possible | ||
# that the configuration is bad. | ||
CONNECT_PROXY=http://localhost:8083 | ||
fi | ||
|
||
CONNECT_URL="${CONNECT_URL:-http://localhost:8083}" | ||
|
||
echo | ||
echo "Enabling proxy because Connect doesn't send CORS headers yet." | ||
cat <<EOF >>/caddy/Caddyfile | ||
proxy /api/kafka-connect $CONNECT_URL { | ||
without /api/kafka-connect | ||
} | ||
EOF | ||
|
||
CONNECT_URL=/api/kafka-rest-proxy | ||
|
||
cat <<EOF >/kafka-connect-ui/env.js | ||
var clusters = [ | ||
{ | ||
NAME: "default", | ||
KAFKA_CONNECT: "$CONNECT_PROXY" | ||
} | ||
] | ||
EOF | ||
|
||
echo | ||
|
||
exec /caddy/caddy -conf /caddy/Caddyfile |