Skip to content

Commit c78d52e

Browse files
Improve docker instructions
Signed-off-by: Andrew Schofield <andrew_schofield@uk.ibm.com>
1 parent f2c39ba commit c78d52e

File tree

1 file changed

+17
-6
lines changed

1 file changed

+17
-6
lines changed

README.md

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -83,14 +83,25 @@ curl -X POST -H "Content-Type: application/json" http://localhost:8083/connector
8383

8484
## Running with Docker
8585

86-
This repository includes a Dockerfile to run Kafka Connect in distributed mode. It also adds in the MQ source connector as an available connector plugin. It uses the default `connect-distributed.properties` and `connect-log4j.properties` files.
86+
This repository includes an example Dockerfile to run Kafka Connect in distributed mode. It also adds in the MQ source connector as an available connector plugin. It uses the default `connect-distributed.properties` and `connect-log4j.properties` files.
8787

8888
1. `mvn clean package`
89-
1. `docker build -t kafkaconnect-with-mq-source:0.0.1 .`
90-
1. `docker run -p 8083:8083 kafkaconnect-with-mq-source:0.0.1`
89+
1. `docker build -t kafkaconnect-with-mq-source:1.3.0 .`
90+
1. `docker run -p 8083:8083 kafkaconnect-with-mq-source:1.3.0`
91+
92+
**NOTE:** To provide custom properties files create a folder called `config` containing the `connect-distributed.properties` and `connect-log4j.properties` files and use a Docker volume to make them available when running the container like this:
93+
94+
``` shell
95+
docker run -v $(pwd)/config:/opt/kafka/config -p 8083:8083 kafkaconnect-with-mq-source:1.3.0
96+
```
97+
98+
To start the MQ connector, you can use `config/mq-source.json` in this repository after replacing all placeholders and use a command like this:
99+
100+
``` shell
101+
curl -X POST -H "Content-Type: application/json" http://localhost:8083/connectors \
102+
--data "@./config/mq-source.json"
103+
```
91104

92-
**NOTE:** To provide custom properties files create a folder called `config` containing the `connect-distributed.properties` and `connect-log4j.properties` files and use a Docker volume to make them available when running the container:
93-
`docker run -v $(pwd)/config:/opt/kafka/config -p 8083:8083 kafkaconnect-with-mq-source:0.0.1`
94105

95106
## Deploying to Kubernetes
96107

@@ -112,7 +123,7 @@ Create ConfigMap for Kafka Connect Log4j configuration:
112123

113124
### Creating Kafka Connect deployment and service in Kubernetes
114125

115-
**NOTE:** Remember to [build the Docker image](#running-with-docker) and push it to your Kubernetes image repository. You might need to update the image name in the `kafka-connect.yaml` file.
126+
**NOTE:** You will need to [build the Docker image](#running-with-docker) and push it to your Kubernetes image repository. Remember that the supplied Dockerfile is just an example and you will have to modify it for your needs. You might need to update the image name in the `kafka-connect.yaml` file.
116127

117128
1. Update the namespace in `kafka-connect.yaml`
118129
1. `kubectl -n <namespace> apply -f kafka-connect.yaml`

0 commit comments

Comments
 (0)