Skip to content

Commit 8860a80

Browse files
committed
update dockerfile to have official kafka image as base image
1 parent cbfccab commit 8860a80

File tree

1 file changed

+8
-17
lines changed

1 file changed

+8
-17
lines changed

kafka-connect/Dockerfile

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,21 @@
1-
# This dockerfile expects Connector jars to have been built under a `connectors` directory
2-
#
3-
FROM alpine as builder
1+
FROM apache/kafka:latest
42

5-
RUN apk update
6-
RUN apk --no-cache add curl
7-
8-
RUN curl -L "https://downloads.apache.org/kafka/3.4.1/kafka_2.12-3.4.1.tgz" -o kafka.tgz
9-
RUN mkdir /opt/kafka \
10-
&& tar -xf kafka.tgz -C /opt/kafka --strip-components=1
11-
12-
FROM ibmjava:11
3+
USER root
134

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

17-
COPY --chown=esuser:esgroup --from=builder /opt/kafka/bin/ /opt/kafka/bin/
18-
COPY --chown=esuser:esgroup --from=builder /opt/kafka/libs/ /opt/kafka/libs/
19-
COPY --chown=esuser:esgroup --from=builder /opt/kafka/config/ /opt/kafka/config/
20-
RUN mkdir /opt/kafka/logs && chown esuser:esgroup /opt/kafka/logs
8+
RUN mkdir -p /opt/kafka/plugins/ && \
9+
mkdir -p /opt/kafka/logs/ && \
10+
chown -R esuser:esgroup /opt/kafka/plugins/ && \
11+
chown -R esuser:esgroup /opt/kafka/logs/
2112

22-
COPY --chown=esuser:esgroup connectors /opt/connectors
13+
COPY --chown=esuser:esgroup connectors /opt/kafka/plugins/
2314

2415
WORKDIR /opt/kafka
2516

2617
EXPOSE 8083
2718

2819
USER esuser
2920

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

0 commit comments

Comments
 (0)