So I have decided to dip my toes into the world of mqtt iot devices. I have some very basic questions that I was hoping someone could answer. I have decided that I wanted to go the Docker route because it seems like a sane way to keep from messing my machine up with brew installs. My question is with regards to persisting data across the docker container reboots. Most of the docs I have found say that I would want to save the following data :
- /mosquitto/config
/mosquitto/data
/mosquitto/log
My question is which of the two methods of creating persistent data are people using?
- Volumes
Bind Mounts
According to the Docker documentation, volumes are the preferred approach, but you can't browse the data from the host's file system. I'm pretty sure that I would/should not be mucking withe the /mosquitto/data directory from outside the container while it is running but it makes it easier to backup if it's bind mounted to a Mac host directory. The other two would be nice to have access to. After a time though, I don't think that I would be modifying the config file much.
Any suggestions on what is the best route? I'm assuming that I could use both, creating a docker volume for the data, and binding the config and log files.