mosquitto
mosquitto copied to clipboard
Add Support for PGID and PUID Docker Enviroment Variables
Version: 2.0.14
When persistenting data volumes all files are owned by user 1883
docker-compose.yml
services:
#Eclipse Mosquitto
mosquitto:
container_name: eclipse-mosquitto
image: eclipse-mosquitto:latest
restart: unless-stopped
environment:
- PGID=1000
- PUID=1000
- UMASK_SET=000
deploy:
resources:
limits:
memory: 125M
ports:
- "1883:1883"
- "9001:9001"
volumes:
- ./data-mosquitto/config:/mosquitto/config
- ./data-mosquitto/data:/mosquitto/data
- ./data-mosquitto/log:/mosquitto/log
~/data-mosquitto/config$ ls -l
drwxrwxr-x 2 1883 1883 4096 Jan 18 12:20 ./
drwxrwxr-x 5 user user 4096 Jan 16 01:04 ../
-rw-r--r-- 1 1883 1883 207 Jan 18 12:20 mosquitto.conf
-rw-r--r-- 1 1883 1883 121 Jan 16 02:24 mosquitto.passwd
Can support for PGID and PUID be added so logs are easily viewble on host machine without ROOT?
Thanks
I also ask for support of PGID and PUID as Environment variables of docker compose to be actually acknowledged.
Why is this change only done for the local docker file?
Also running into this, always uid/gid 1883.
It would be really useful if this issue were 'sorted'..... please
+1 for me!
Hello, It seems to me that the "user" parameter does the trick :
services:
mosquitto:
image: eclipse-mosquitto:latest
container_name: mosquitto
user: "1000:1000"
[...]
Setting user
didn't work for me, files are still owned by 1883.
Accepting UID/GID/TZ is a really standard thing for docker containers to do, otherwise makes it very hard to map permissions back to the host.
Looks like it's on the develop branch, might that make it into a release at some point @ralight?
2024 and this issue still persists. running this container on a system you dont have root access on makes the config file uneditable and config/data/log folders unremovable.
Setting up a new environment and am really surprised this is still not fixed.
Setting up a new environment and am really surprised this is still not fixed.
I agree. Makes developing my docker stack a PIA, I can't sync to GitHub without excluding Mosquito config files.
Setting
user
didn't work for me, files are still owned by 1883.
It worked for me but I had to first stop mosquitto, chown the files with my PUID and GUID, update the docker compose and then restart it.