Table of Contents
Important

The Docker images produced from this repository uses, as base image, the one available at mcr.microsoft.com/dotnet/runtime:8.0 (latest is mcr.microsoft.com/dotnet/runtime:8.0-jammy). Within GitHub Container Registry you can find many legal information, specifically read carefully the following before use the image:

KNet: Docker images

.NET suite for Apache Kafka™ comes with a ready made Docker image can work in multiple modes, the image name is knet:

The container image can work in multiple modes based on the environment variable KNET_DOCKER_RUNNING_MODE:

  • KNET_DOCKER_RUNNING_MODE not existent or empty: the image expect to run in command-line mode and it is the default behavior. The Docker image invokes the command-line module KNetCLI using the same commands available in KNet CLI usage:

    • With the following:

    docker run -it knet [commands]

    • the Docker image will issue the command:

    dotnet /app/MASES.KNetCLI.dll $@

  • The image can run ZooKeeper™ node and/or Apache Kafka™ broker node using specific values for KNET_DOCKER_RUNNING_MODE:

    • KNET_DOCKER_RUNNING_MODE=zookeeper: starts a ZooKeeper™ node, defaults to run a standalone ZooKeeper™ exposing on port 2181

      • the Docker image will issue the command:

      dotnet /app/MASES.KNetCLI.dll zookeeperstart -Log4JConfiguration /app/config_container/log4j.properties /app/config_container/zookeeper.properties

    • KNET_DOCKER_RUNNING_MODE=broker: starts an Apache Kafka™ broker node, defaults to run a standalone broker exposing on port 9092

      • the Docker image will issue the command:

      dotnet /app/MASES.KNetCLI.dll kafkastart -Log4JConfiguration /app/config_container/log4j.properties /app/config_container/server.properties

    • KNET_DOCKER_RUNNING_MODE=server: starts, within the container, both a ZooKeeper™ node and an Apache Kafka™ broker node, it defaults to run exposing ZooKeeper™ on port 2181 and Apache Kafka™ broker on port 9092; the image can add, or update, configuration variables of ZooKeeper™ and Apache Kafka™ using the same pattern of previous points.

  • The image can run Apache Kafka™ in KRaft mode using specific values for KNET_DOCKER_RUNNING_MODE:

    • KNET_DOCKER_RUNNING_MODE=kraft-broker: starts a Apache Kafka™ as broker node

      • the Docker image will issue the command:

      dotnet /app/MASES.KNetCLI.dll kafkastart -Log4JConfiguration /app/config_container/log4j.properties /app/config_container/kraft/broker.properties

    • KNET_DOCKER_RUNNING_MODE=kraft-controller: starts a Apache Kafka™ as controller node

      • the Docker image will issue the command:

      dotnet /app/MASES.KNetCLI.dll kafkastart -Log4JConfiguration /app/config_container/log4j.properties /app/config_container/kraft/controller.properties

    • KNET_DOCKER_RUNNING_MODE=kraft-server: starts a Apache Kafka™ as server node

      • the Docker image will issue the command:

      dotnet /app/MASES.KNetCLI.dll kafkastart -Log4JConfiguration /app/config_container/log4j.properties /app/config_container/kraft/server.properties

  • The image can run both Apache Connect and KNet Connect using specific values for KNET_DOCKER_RUNNING_MODE:

    • KNET_DOCKER_RUNNING_MODE=knet-connect-standalone: starts, within the container, a standalone KNet Connect instance

      • the Docker image will issue the command:

      dotnet /app/MASES.KNetConnect.dll -s -k -Log4JConfiguration /app/config_container/log4j.properties /app/config_container/connect-standalone.properties /app/config_container/connect-knet-specific.properties

    • KNET_DOCKER_RUNNING_MODE=connect-standalone: starts, within the container, a standalone Apache Connect instance

      • the Docker image will issue the command:

      dotnet /app/MASES.KNetConnect.dll -s -Log4JConfiguration /app/config_container/log4j.properties /app/config_container/connect-standalone.properties /app/config_container/connect-knet-specific.properties

      • the image can add, or update, configuration variables of connect-standalone.properties and connect-knet-specific.properties using the same pattern of knet-connect-standalone:
    • KNET_DOCKER_RUNNING_MODE=knet-connect-standalone-server: starts, within the container, a ZooKeeper™ node and an Apache Kafka™ broker node like in server, then starts the same command of knet-connect-standalone; this is an autonoumous instance can be used for development or any other possible usage

      • the image can add, or update, configuration variables of using the same pattern of zookeeper, broker and knet-connect-standalone
    • KNET_DOCKER_RUNNING_MODE=connect-standalone-server: starts, within the container, a ZooKeeper™ node and an Apache Kafka™ broker node like in server, then starts the same command of connect-standalone; this is an autonoumous instance can be used for development or any other possible usage

      • the image can add, or update, configuration variables of using the same pattern of zookeeper, broker and connect-standalone
    • KNET_DOCKER_RUNNING_MODE=knet-connect-distributed: starts, within the container, a distributed KNet Connect instance

      • the Docker image will issue the command:

      dotnet /app/MASES.KNetConnect.dll -d -k -Log4JConfiguration /app/config_container/log4j.properties /app/config_container/connect-distributed.properties

    • KNET_DOCKER_RUNNING_MODE=connect-distributed: starts, within the container, a distributed Apache Connect instance

      • the Docker image will issue the command:

      dotnet /app/MASES.KNetConnect.dll -d -Log4JConfiguration /app/config_container/log4j.properties /app/config_container/connect-distributed.properties

      • the image can add, or update, configuration variables of connect-distributed.propertiesusing the same pattern of knet-connect-distributed:
    • All previous commands use a single configuration file for logging; the image can add, or update, configuration variables of log4j.properties using the following pattern for environment variables: