Skip to content

feat: Update Docker Image to Use Official Kafka Images #95

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 7 additions & 19 deletions kafka-connect/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,30 +1,18 @@
# This dockerfile expects Connector jars to have been built under a `connectors` directory
#
FROM alpine as builder
FROM apache/kafka:latest

RUN apk update
RUN apk --no-cache add curl

RUN curl -L "https://downloads.apache.org/kafka/3.4.0/kafka_2.12-3.4.0.tgz" -o kafka.tgz
RUN mkdir /opt/kafka \
&& tar -xf kafka.tgz -C /opt/kafka --strip-components=1

FROM ibmjava:11
USER root

RUN addgroup --gid 5000 --system esgroup && \
adduser --uid 5000 --ingroup esgroup --system esuser

COPY --chown=esuser:esgroup --from=builder /opt/kafka/bin/ /opt/kafka/bin/
COPY --chown=esuser:esgroup --from=builder /opt/kafka/libs/ /opt/kafka/libs/
COPY --chown=esuser:esgroup --from=builder /opt/kafka/config/ /opt/kafka/config/
RUN mkdir /opt/kafka/logs && chown esuser:esgroup /opt/kafka/logs
adduser --uid 5000 --ingroup esgroup --system esuser && \
mkdir -p /opt/kafka/plugins /opt/kafka/logs && \
chown -R esuser:esgroup /opt/kafka/plugins /opt/kafka/logs

COPY --chown=esuser:esgroup connectors /opt/connectors
COPY --chown=esuser:esgroup connectors /opt/kafka/plugins/

WORKDIR /opt/kafka

EXPOSE 8083

USER esuser

ENTRYPOINT ["./bin/connect-distributed.sh", "config/connect-distributed.properties"]
ENTRYPOINT ["bin/connect-distributed.sh", "config/connect-distributed.properties"]