Mqtt Docker Setup

That docker command looks correct to me (if not a bit sparse compared to mine).

I’m not sure why you are needing to use the docker network IP address to connect to the broker from HA. You should be able to access it at the ip address of the docker host machine at the port setup in your docker command.

Maybe it has something to do with permissions accessing the container.

As I said my docker command has a bunch more environment variables in it as was recommended by the eclipse mosquitto docker hub instructions that I followed at the time.

Here is mine if it helps guide you:

sudo docker run -d --name=eclipse-mosquitto --restart=unless-stopped -p 1883:1883 -p 9001:9001 -v /home/finity/docker/mqtt/config/mosquitto.conf:/mosquitto/config/mosquitto.conf -v /home/finity/docker/mqtt/config/passwd:/mosquitto/config/passwd -v /home/finity/docker/mqtt/data:/mosquitto/data -v /home/finity/docker/mqtt/log:/mosquitto/log -e PGID=1000 -e PUID=1000 -e UMASK_SET=000 eclipse-mosquitto