Building Kafka Connect Image using Dockerfile

Hello ,
I am Newbie to Confluent and Kafka world!

I am building a kafka connect docker image using docker file provided in confluent github. repo. Its integrated with Azure pipelines and i don’t have option to pass run time args to docker build. What would be best approach to overcome the limitation?
can i hard-code ARGS in Dockerfile?

ARG DOCKER_UPSTREAM_REGISTRY=Docker Hub
ARG DOCKER_UPSTREAM_TAG=5.2.5-10
ARG DOCKER_TAG=5.2.5-10

Hi Shahed,

so welcome :slight_smile:

Did I get it wright:
you’re trying to build the Kafka connect image with tag 5.2.5-10 ?

If I remember right you should be able to set the tag in you yaml file like

variables:
  ImageName: 'confluentinc/cp-kafka-connect:5.2.5-10'

Best,
Michael

Thanks Michael for response :slight_smile:

I will try this.
Appreciate if you can also point me to any documentation that explains process of building Kafka connect image using docker build. Basically looking for what args / env values to pass at build time.

I would recommend these documentation

https://docs.confluent.io/platform/current/installation/docker/development.html#extending-images

using this image

1 Like

I was able to build the image. When i try to instantiate a container i get following error
udo docker run 42ba7d8faaa5
===> User
uid=1000(appuser) gid=1000(appuser) groups=1000(appuser)
===> Configuring …
CONNECT_BOOTSTRAP_SERVERS is required.
Command [/usr/local/bin/dub ensure CONNECT_BOOTSTRAP_SERVERS] FAILED !

Later i tried providing bootstrap server as envronment variable

docker run -e CONNECT_BOOTSTRAP_SERVERS = localhost:9092 42ba7d8faaa5

but it fails too with
docker: invalid reference format.

any syntax that i need to follow to pass the variable?

Appreciate your help!

hey,

seems as there is a space in your command
it should be
docker run -e CONNECT_BOOTSTRAP_SERVERS=localhost:9092 42ba7d8faaa5

HTH,
Michael

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.