简体   繁体   中英

Docker image for Confluent - adding Confluent Hub connectors

I wanted to slightly modify Confluent's Git repo Dockerfile to have in my Confluent Connect page mongoDB and Snowflake connections. Everything runs ok but I don't see them in the portal.

Should docker-compose.yml be modified as well?

Original code:

FROM confluentinc/cp-server-connect-base:5.5.1

ENV CONNECT_PLUGIN_PATH="/usr/share/java,/usr/share/confluent-hub-components"

ARG CONNECTOR_NAME
RUN confluent-hub install --no-prompt confluentinc/${CONNECTOR_NAME}:5.5.0

Moded code:

FROM confluentinc/cp-server-connect-base:5.5.1

ENV CONNECT_PLUGIN_PATH="/usr/share/java,/usr/share/confluent-hub-components"

ARG CONNECTOR_NAME
RUN confluent-hub install --no-prompt confluentinc/${CONNECTOR_NAME}:5.5.0 \
   && confluent-hub install --no-prompt mongodb/kafka-connect-mongodb:1.2.0 \
   && confluent-hub install --no-prompt snowflakeinc/snowflake-kafka-connector:1.4.3

I think you can try to do the following.

  1. Modify your Dockerfile :
FROM confluentinc/cp-server-connect-base:5.5.1

ENV CONNECT_PLUGIN_PATH="/usr/share/java,/usr/share/confluent-hub-components"

RUN confluent-hub install --no-prompt mongodb/kafka-connect-mongodb:1.2.0 \
   && confluent-hub install --no-prompt snowflakeinc/snowflake-kafka-connector:1.4.3

Since you need to install only mongodb and snowflake connectors.

  1. Use your custom image in docker-compose.yml :
...
  connect:
    # image: cnfldemos/cp-server-connect-datagen:0.3.2-5.5.0
    build: .
    hostname: connect
    container_name: connect
...

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM