Docker 容器无法在主机(Windows 10)上的端口 1883 上看到代理

Docker 容器无法在主机(Windows 10)上的端口 1883 上看到代理

我有一个在 Windows 10 中运行的 MQTT 代理 (mosquitto)。它经过测试,可以在 127.0.0.1 上完全正常工作。我有一个 Chirpstack Gateway Bridge 的 Docker 容器。它尝试通过端口 1883 连接到代理,但总是失败。我应该在代理的日志中看到它连接失败,但那里什么也没有出现。即使代理已关闭,也会出现相同的错误“连接被拒绝”。我怀疑容器没有脱离自身与主机上的端口 1883 进行通信。你的想法?

PS C:\BRIDGE> docker compose up
[+] Running 1/0
 - Container bridge-lora-bridge-1  Created                                                                                                                      0.0s
Attaching to bridge-lora-bridge-1
bridge-lora-bridge-1  | INFO[0000] starting ChirpStack Gateway Bridge            docs="https://www.chirpstack.io/gateway-bridge/" version=
bridge-lora-bridge-1  | INFO[0000] backend/semtechudp: starting gateway udp listener  addr="0.0.0.0:1700"
bridge-lora-bridge-1  | ERRO[0000] [client]   dial tcp 127.0.0.1:1883: connect: connection refused  module=mqtt
bridge-lora-bridge-1  | WARN[0000] [client]   failed to connect to broker, trying next  module=mqtt
bridge-lora-bridge-1  | ERRO[0000] [client]   Failed to connect to a broker      module=mqtt
bridge-lora-bridge-1  | FATA[0000] network Error : dial tcp 127.0.0.1:1883: connect: connection refused
bridge-lora-bridge-1 exited with code 1

docker-composer.yml 的内容

version: "3.6"
services:
  lora-bridge:
    image: chirpstack/chirpstack-gateway-bridge
    stdin_open: true # docker run -i
    tty: true  # docker run -t
    privileged: true
    volumes: 
      - C:\BRIDGE\.config:/etc/chirpstack-gateway-bridge/
    ports:
      - 1883:1883
      - 1700:1700
 

相关内容