I want to utilize Docker Desktop as a host/broker for MQTT with the goal that I can monitor Thingsboard telemetry on my notebook’s browser. The data will arrive by a microcontroller connected to the notebook via Ethernet cable. How can I set the IP address in Docker Desktop for this configuration? I am asking, because the microcontroller publishes the topics towards a specific host IP address. So, I want to ensure that the Docker Desktop actually has this specific IP address, in order to receive the MQTT messages coming from the microcontroller via Ethernet.
I tried it…but my microcontroller says it is cannot open the connection with the broker. Are we sure I can just plug an Ethernet cable to a MacBookPro and the DockerDesktop will recognize this?
Since Docker Desktop runs a virtual machine and runs Docker in it, we are sure an ethernet cable plugged into the host machine would not affect the virtual machine. I think @bluepuma77 meant that if you need an IP that you can send requests to, you can use your host machines IP address and forward ports from the host into the container in the virtual machine using the standard port forward feature of Docker. If you want something to listen on an IP address, that wont work as TDockr Desktop’s VM has its own private network and its’ IP address is available only in the virtual machine.
Can you share more about what you are trying to do exactly. Unfortunately I didn’t have to work with Kafka a lot, so I would need a little more info to say something useful.
Thank you @rimelek (and @bluepuma77 ) , I understand now, that just plugging a cable doesn’t solve it so easy. Apparently I cannot attach an image showing visually the concept of what I try to achieve, to this forum thread… I will try to be back as soon as possible.
It is a docking station of type Dell UD22. The notebook connects to it via an USB-C / Thunderbolt cable. And the Microcontroller should connect there via RJ45-LAN port.
Exactly, it works when my notebook is connected with the μCU’s RJ45 port via the USB-LAN adapter. In this case I see in my Mac’s network settings a green dot and “Lenovo USB-C to LAN 2:
IPv4 Configured: manually
IP address: 10.4.16.120
Subnet mask: 255.255.0.0
However if I connect the both the notebook and μCU to the docking station then there is no telemetry, and I see in my Mac’s network settings a yellow dot and “Dell Universal Hybrid Video Doc:
IPv4 Configured: using DHCP
IP address: (…completely different address, no commonality with before)
So you manually configured the USB-C Adapter with an IP. But the Docking Station is not configured, it’s waiting for an IP via DHCP. But I assume it doesn’t have a second LAN interface and is not connected to a router/server. So you need to set an IP manually, as you have done for the other adapter.
It worked many thanks.
I am still a bit confused whether the notebook itself and the docking station have the same IP address. Will do some more research on my end