Currently after I deploy Kafka to a machine, I need to run the following commands so it can be configured correctly:
docker run --net=azure-iot-edge --rm confluentinc/cp-kafka:5.1.2 kafka-topics --list --zookeeper zookeeper:2181
docker run --net=azure-iot-edge --rm confluentinc/cp-kafka:5.1.2 kafka-topics --create --topic new-project --zookeeper zookeeper:2181 --partitions 3 --replication-factor 1
docker run --net=azure-iot-edge --rm confluentinc/cp-kafka:5.1.2 kafka-topics --describe --zookeeper zookeeper:2181 --topic new-project
The problem is that i'm deploying this to a machine that does have Docker Run
so I can no longer configure it.
In order to get around this, I'm trying to create a custom Kafka image that already have these configurations.
So I created a dockerfile
that pull the image and run these configurations but that doesn't work because docker
isn't available inside the dockerfile
. I get the following error when I try to create the image: /bin/sh: 1: docker: not found
.
This is how the dockerfile
looks like:
FROM confluentinc/cp-kafka:5.1.2
RUN docker run --net=azure-iot-edge --rm confluentinc/cp-kafka:5.1.2 kafka-topics --list --zookeeper zookeeper:2181
RUN docker run --net=azure-iot-edge --rm confluentinc/cp-kafka:5.1.2 kafka-topics --create --topic new-project --zookeeper zookeeper:2181 --partitions 3 --replication-factor 1
RUN docker run --net=azure-iot-edge --rm confluentinc/cp-kafka:5.1.2 kafka-topics --describe --zookeeper zookeeper:2181 --topic new-project
Anyone faced a similar issue and can offer some guidance?