Skip to content

Commit 6015618

Browse files
committed
added dockerfile, better run.sh, relocated offsets. this fixes #3
1 parent 812875b commit 6015618

File tree

5 files changed

+13
-7
lines changed

5 files changed

+13
-7
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
standalone.offsets
21
target/
32
.idea/
43
*.log

Dockerfile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
FROM confluentinc/cp-kafka-connect:3.2.0
2+
3+
WORKDIR /kafka-connect-source-github
4+
COPY config config
5+
COPY target target
6+
7+
CMD connect-standalone config/worker.properties config/GitHubSourceConnectorExample.properties

config/worker.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,5 @@ internal.value.converter.schemas.enable=true
1313
rest.port=8086
1414
rest.host.name=127.0.0.1
1515
# this config is only for standalone workers
16-
offset.storage.file.filename=standalone.offsets
16+
offset.storage.file.filename=offsets/standalone.offsets
1717
offset.flush.interval.ms=10000

offsets/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
standalone.offsets

run.sh

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,11 @@
22
export CLASSPATH="$(find target/ -type f -name '*.jar'| grep '\-package' | tr '\n' ':')"
33
if hash docker 2>/dev/null; then
44
# for docker lovers
5+
docker build . -t simplesteph/kafka-connect-source-github:1.0
56
docker run -e CLASSPATH=$CLASSPATH \
6-
--net=host --rm \
7-
-v $(pwd):/kafka-connect-github-source \
8-
-w /kafka-connect-github-source \
9-
confluentinc/cp-kafka-connect:3.2.0 \
10-
connect-standalone config/worker.properties config/GitHubSourceConnectorExample.properties
7+
--net=host --rm -t \
8+
-v $(pwd)/offsets:/kafka-connect-source-github/offsets \
9+
simplesteph/kafka-connect-source-github:1.0
1110
elif hash connect-standalone 2>/dev/null; then
1211
# for mac users who used homebrew
1312
connect-standalone config/worker.properties config/GitHubSourceConnectorExample.properties

0 commit comments

Comments
 (0)