|
| 1 | +# Copyright 2018 The Hyve |
| 2 | +# |
| 3 | +# Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | +# you may not use this file except in compliance with the License. |
| 5 | +# You may obtain a copy of the License at |
| 6 | +# |
| 7 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | +# |
| 9 | +# Unless required by applicable law or agreed to in writing, software |
| 10 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | +# See the License for the specific language governing permissions and |
| 13 | +# limitations under the License. |
| 14 | + |
| 15 | +FROM --platform=$BUILDPLATFORM gradle:8.9-jdk17 AS builder |
| 16 | + |
| 17 | +RUN mkdir /code |
| 18 | +WORKDIR /code |
| 19 | + |
| 20 | +ENV GRADLE_USER_HOME=/code/.gradlecache \ |
| 21 | + GRADLE_OPTS="-Dorg.gradle.vfs.watch=false -Djdk.lang.Process.launchMechanism=vfork" |
| 22 | + |
| 23 | +COPY buildSrc /code/buildSrc |
| 24 | +COPY ./build.gradle.kts ./settings.gradle.kts ./gradle.properties /code/ |
| 25 | +COPY kafka-connect-rest-source/build.gradle.kts /code/kafka-connect-rest-source/ |
| 26 | +COPY kafka-connect-fitbit-source/build.gradle.kts /code/kafka-connect-fitbit-source/ |
| 27 | + |
| 28 | +RUN gradle downloadDependencies copyDependencies |
| 29 | + |
| 30 | +COPY ./kafka-connect-rest-source/src/ /code/kafka-connect-rest-source/src |
| 31 | +COPY ./kafka-connect-fitbit-source/src/ /code/kafka-connect-fitbit-source/src |
| 32 | + |
| 33 | +RUN gradle jar |
| 34 | + |
| 35 | +FROM confluentinc/cp-kafka-connect-base:7.8.1 |
| 36 | + |
| 37 | +USER appuser |
| 38 | + |
| 39 | +LABEL org.opencontainers.image.authors=" [email protected]" |
| 40 | + |
| 41 | +LABEL description="Kafka REST API Source connector" |
| 42 | + |
| 43 | +ENV CONNECT_PLUGIN_PATH="/usr/share/java/kafka-connect/plugins" \ |
| 44 | + WAIT_FOR_KAFKA="1" |
| 45 | + |
| 46 | +# To isolate the classpath from the plugin path as recommended |
| 47 | +COPY --from=builder /code/kafka-connect-rest-source/build/third-party/*.jar ${CONNECT_PLUGIN_PATH}/kafka-connect-rest-source/ |
| 48 | +COPY --from=builder /code/kafka-connect-fitbit-source/build/third-party/*.jar ${CONNECT_PLUGIN_PATH}/kafka-connect-fitbit-source/ |
| 49 | + |
| 50 | +COPY --from=builder /code/kafka-connect-rest-source/build/libs/*.jar ${CONNECT_PLUGIN_PATH}/kafka-connect-rest-source/ |
| 51 | +COPY --from=builder /code/kafka-connect-rest-source/build/libs/*.jar ${CONNECT_PLUGIN_PATH}/kafka-connect-fitbit-source/ |
| 52 | +COPY --from=builder /code/kafka-connect-fitbit-source/build/libs/*.jar ${CONNECT_PLUGIN_PATH}/kafka-connect-fitbit-source/ |
| 53 | + |
| 54 | +# Load topics validator |
| 55 | +COPY --chown=appuser:appuser ./docker/legacy/ensure /etc/confluent/docker/ensure |
| 56 | + |
| 57 | +# Load modified launcher |
| 58 | +COPY --chown=appuser:appuser ./docker/legacy/launch /etc/confluent/docker/launch |
| 59 | + |
| 60 | +# Overwrite the log4j configuration to include Sentry monitoring. |
| 61 | +COPY ./docker/log4j.properties.template /etc/confluent/docker/log4j.properties.template |
| 62 | +# Copy Sentry monitoring jars. |
| 63 | +COPY --from=builder /code/kafka-connect-fitbit-source/build/third-party/sentry-* /etc/kafka-connect/jars |
0 commit comments