It seems at some point, the location of the config file was changed.
As long as the network_mode
is set to "host" and the config file gets copied into the correct folder in the container then the following yml/configs should work without issue as of 2.0.14:
docker-compose.yml:
version: "3"
services:
mosquitto:
image: eclipse-mosquitto:latest
container_name: mosquitto
network_mode: "host"
volumes:
- ./conf:/mosquitto/config
- ./data:/mosquitto/data
- ./log:/mosquitto/log
conf/mosquitto.conf
persistence true
persistence_location /mosquitto/data/
log_dest file /mosquitto/log/mosquitto.log
listener 1883 0.0.0.0
## Authentication ##
allow_anonymous true
#password_file /mosquitto/conf/mosquitto.conf
Issuing plain-old sudo docker-compose up -d
should work, exposing the ports on the host's network.