Open spierepf opened 2 years ago
I have mine setup like this:
mosquitto:
image: eclipse-mosquitto
container_name: mosquitto_broker
volumes:
- ./mosquitto/:/mosquitto/:rw
ports:
- 1883:1883
- 9001:9001
networks:
- default
and then a folder structure like this:
Who are the owners and what are the permissions on the files? That appears to be where my system is stumbling.
I tried your config. (All files owned by root with normal permissions:
# docker-compose up mosquitto
Creating mosquitto_broker ... done
Attaching to mosquitto_broker
mosquitto_broker | chown: /mosquitto: Permission denied
mosquitto_broker | 1650595839: Error: Unable to open config file /mosquitto/config/mosquitto.conf.
mosquitto_broker exited with code 3
I tried your config. (All files owned by root with normal permissions:
# docker-compose up mosquitto Creating mosquitto_broker ... done Attaching to mosquitto_broker mosquitto_broker | chown: /mosquitto: Permission denied mosquitto_broker | 1650595839: Error: Unable to open config file /mosquitto/config/mosquitto.conf. mosquitto_broker exited with code 3
yeah, that's weird. everyone on my team is doing the same thing with no permission problems.
have you tried running docker-compuse up
as sudo
?
The same here. No matter what I try, there is always the chown: /mosquitto/config/mosquitto.conf: Permission denied
error.
@danielmoncada Running with sudo is not an option. I don't have that privileges available. Anyway, I believe it should be possible to mount a conf file into container without such errors..
To me the root cause of the problem seems to be in how the container is behaving the file - it is trying to chown a file, which is supposed to be bind-mounted from host. That is not the correct behavior, is it?
No matter how I configure my
docker-compose.yml
file in order to run eclipse-mostquitto using a custom mosquitto.conf file, I keep getting a variation on the following error message:I've tried ever suggestion in https://github.com/eclipse/mosquitto/issues/1078 but I keep getting that error.
Is there an 'official' supported way to configure eclipse-mosquitto as a member of a docker-compose?