Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

What is the right way to configure eclipse-mosquitto in a docker-compose file so that it uses a mosquitto.conf file in a volume? #2512

Open
spierepf opened this issue Apr 18, 2022 · 4 comments

Comments

@spierepf
Copy link

spierepf commented Apr 18, 2022

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:

# docker-compose up eclipse-mosquitto
server_eclipse-mosquitto_1 is up-to-date
Attaching to server_eclipse-mosquitto_1
eclipse-mosquitto_1  | chown: /mosquitto/config: Permission denied
eclipse-mosquitto_1  | 1650310347: Error: Unable to open config file /mosquitto/config/mosquitto.conf.

I've tried ever suggestion in #1078 but I keep getting that error.

Is there an 'official' supported way to configure eclipse-mosquitto as a member of a docker-compose?

@danielmoncada
Copy link

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:

  • docker compose
  • mosquitto
    • config
      • mosquitto.conf

@spierepf
Copy link
Author

Who are the owners and what are the permissions on the files? That appears to be where my system is stumbling.

@spierepf
Copy link
Author

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

@danielmoncada
Copy link

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants