1

running Colima with reachable ip: colima start --network-address

then colima list

PROFILE      STATUS     ARCH      CPUS    MEMORY    DISK      RUNTIME    ADDRESS
default      Running    x86_64    4       8GiB      100GiB    docker     192.168.106.2

and after the above, I'm running my docker-compose:

version: "3"

services:
  kafka:
    image: docker.io/bitnami/kafka:3.3
    ports:
      - "9092:9092"
    volumes:
      - "kafka_data:/bitnami"
    environment:
      - KAFKA_CFG_ZOOKEEPER_CONNECT=zookeeper:2181
      - ALLOW_PLAINTEXT_LISTENER=yes

So I'm basically forwarding port "9092" on the kafka container to the host port "9092".

I tried to reach kafka through:

  • "192.168.106.2:9092"
  • "192.168.106.2"
  • "127.0.0.1:9092"
  • "localhost:9092"
  • "0.0.0.0:9092"

but I getting an error. I know kafkaa container is working as I can access it, if Im trying to use it through a container inside the docker network.

how can I access it from my host machine?

Tzook Bar Noy
  • 11,337
  • 14
  • 51
  • 82
  • How do you access it ? Have you tried with localhost ? – Ludwig Jan 29 '23 at 20:51
  • updated the question, tried with many variations – Tzook Bar Noy Jan 29 '23 at 21:14
  • How do you access it ? With docker exec or some network ? Try with KAFKA_ADVERTISED_HOST_NAME=192.168.106.2 or some env variables KAFKA_ADVERTISED_LISTENERS, kafka is a pain to first get started, you get might get some help here https://lankydan.dev/running-kafka-locally-with-docker . – Ludwig Jan 30 '23 at 09:00

0 Answers0