blob: 6bb6f9fea37d64cb22e09748009794011f926b40 [file]
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# Connector-runtime image — a separate process that talks HTTP+CloudEvents to the
# EventMesh runtime and runs source/sink connectors. Built from `dist-connector`
# (connector-runtime jar + deps + every connector plugin under plugin/connector/).
# Same builder constraints as docker/Dockerfile (system gradle 8.5 + JDK 21).
FROM gradle:8.5.0-jdk21 AS builder
USER root
WORKDIR /build
COPY . .
RUN gradle clean dist-connector --no-daemon
# Runtime: ConnectorApplication loads connectors via Class.forName, so bin/start-connector.sh
# flattens plugin/connector/**/*.jar onto the classpath (find is required by that script).
FROM eclipse-temurin:21-jre
RUN apt-get update && apt-get install -y --no-install-recommends locales procps findutils \
&& rm -rf /var/lib/apt/lists/*
RUN localedef -i en_US -f UTF-8 en_US.UTF-8 --quiet
WORKDIR /data/app/connector
COPY --from=builder /build/dist-connector ./
RUN chmod +x bin/*.sh
# Connector admin port is opt-in (CONNECTOR_ADMIN_PORT=0 = off by default). Expose 8083 as the
# conventional port for operators who enable it; the connector otherwise makes only outbound calls.
EXPOSE 8083
ENV DOCKER=true
ENV EVENTMESH_HOME=/data/app/connector
ENV EVENTMESH_LOG_HOME=/data/app/connector/logs
ENV CONFPATH=/data/app/connector/conf
ENV EVENTMESH_RUNTIME_URL=http://localhost:8080
ENV CONNECTOR_ADMIN_PORT=0
ENV CONNECTOR_OFFSET_MODE=remote
ENV CONNECTOR_OFFSET_PATH=/data/app/connector/data/connector-offset
# Connector -D flags, e.g. -Dconnector.1.class=... -Dconnector.1.mode=source -Dconnector.1.topic=t
ENV CONNECTOR_OPTS=""
# Extra -D flags (TLS, …)
ENV JAVA_OPTS=""
CMD ["bash", "bin/start-connector.sh"]