This is a docker-compose file to run a mosquitto mqtt broker in a docker container
git clone https://github.com/devnido/mosquitto-docker
cd mosquitto-docker
mkdir data
mkdir log
mv ./config/pwfile.example ./config/pwfile
docker-compose up -d
docker exec -it mqtt mosquitto_passwd -U /mosquitto/config/pwfile
docker restart mqtt
default credentials
username: admin
password: 1234567890