toke / docker-mosquitto Goto Github PK
View Code? Open in Web Editor NEWDocker file for eclipse mosquitto MQTT broker
Home Page: https://registry.hub.docker.com/u/toke/mosquitto/
License: BSD 3-Clause "New" or "Revised" License
Docker file for eclipse mosquitto MQTT broker
Home Page: https://registry.hub.docker.com/u/toke/mosquitto/
License: BSD 3-Clause "New" or "Revised" License
At the moment, Mosquitto's APT repo key is downloaded from https://repo.mosquitto.org/debian/mosquitto-repo.gpg.key while building the docker image.
I suggest adding the verified key to docker's build context (to this git repo) and copying it into the image during build to mitigate possible security issues during build (in which the key is not verified).
First off... Thank you for building the Dockerfile for mosquitto!
The debian package mosquitto creates the user mosquitto.
During docker-mosquitto build the following line is printed (at least for me):
The system user `mosquitto' already exists. Exiting.
---> 76775d4bf147
I comment out the adduser
line in the Dockerfile and built a container and tested:
brucelowther@DeepThought:~/src/Docker/docker-mosquitto$ docker run -ti -u mosquitto mosquitto:woadduser id
uid=104(mosquitto) gid=107(mosquitto) groups=107(mosquitto)
Indicates that the user is created even though the adduser
line is commented out.
Confirmed this by looking at the debian package build:
mosquitto.postinst
From the postinst step, it will use the existing mosquitto uid rather than creating a uid.
Recommend flipping the two steps in the Dockerfile.
The reason this is important to me is that I want to match up the UID on the docker server (121) with the UID created in the container.
May be short sighted, but it works for me right now.
adduser --uid 121 --system --disabled-password --disabled-login mosquitto && \
apt-get update && apt-get install -y mosquitto mosquitto-clients
Then I get UID that matches the target system.
brucelowther@DeepThought:~/src/Docker/docker-mosquitto$ docker run -ti -u mosquitto mosquitto:flipadduser id
uid=121(mosquitto) gid=65534(nogroup) groups=65534(nogroup)
I'm a novice.. hope this is clearly described.
Hi there. Thanks for making it super-easy for me to configure docker images with Mosquitto. In the end I'll be creating my own images, but this provides a really valuable starting point.
I find the following issue when launching and closing the image, though. It appears not to be able to write to the proper location (although it's loading, I guess the relevant folders are read only). The broker comes up and is functional, however.
This is following the simple 'run' instructions at https://github.com/toke/docker-mosquitto
I guess changing the conf to not employ persistence or logging would eliminate these.
dyn-10-32-103-135:~ cefn$ docker run -ti -p 1883:1883 -p 9001:9001 toke/mosquitto
1457349224: Error: Unable to open log file /mqtt/log/mosquitto.log for writing.
1457349224: mosquitto version 1.4.8 (build date Sun, 14 Feb 2016 15:06:55 +0000) starting
1457349224: Config loaded from /mqtt/config/mosquitto.conf.
1457349224: Opening websockets listen socket on port 9001.
1457349224: Opening ipv4 listen socket on port 1883.
1457349224: Opening ipv6 listen socket on port 1883.
^C1457349239: mosquitto version 1.4.8 terminating
1457349239: Saving in-memory database to /mqtt/data/mosquitto.db.
1457349239: Error saving in-memory database, unable to open /mqtt/data/mosquitto.db.new for writing.
1457349239: Error: Permission denied.
Running on QNAP Container station.
docker run -ti --net=host -p 1884:1884 -p 9004:9004
-v /share/Containers/mosquitto-int/config:/mqtt/config:ro
-v /share/Containers/mosquitto-int/log:/mqtt/log:rw
-v /share/Containers/mosquitto-int/data/:/mqtt/data/
--name mqtt-int -d toke/mosquitto
conf file:
log_dest file /mqtt/log/mosquitto.log
I had to comment out config log path due to error.
[/share/CACHEDEV1_DATA/Containers/mosquitto-int/log] # docker logs mqtt-int
1473191957: Error: Unable to open log file /mqtt/log/mosquitto.log for writing.
In shell I can manually write to /mqtt/log/ with no problem and on the host side the created file or folder is owned by admin.
root@b91c2abe1a34:/mqtt/log# ls -la
total 20
drwxrwxrwx+ 3 root root 4096 Sep 6 20:03 .
drwxr-xr-x 5 mosquitto mosquitto 4096 Sep 2 15:18 ..
drwxrwx---+ 2 root root 4096 Sep 6 20:03 test
[/share/CACHEDEV1_DATA/Containers/mosquitto-int/log] # ls -la
drwxrwxrwx 3 admin administ 4096 Sep 6 13:03 ./
drwxrwxrwx 5 admin administ 4096 Sep 1 18:47 ../
drwxrwx--- 2 admin administ 4096 Sep 6 13:03 test/
I am somewhat new to this so am I missing something obvious?
Given the only feature of Q you use is q.defer()
is there any chance of removing this dependency?
Mozilla provides an alternative implementation.
https://developer.mozilla.org/en-US/docs/Mozilla/JavaScript_code_modules/Promise.jsm/Deferred
Hi,
I installed the latest toke Mosquito by docker at my Synology NAS.
Mosquitto is running normal, and I could connect with Domoticz. But isn't possible to connect MQTT with Sonoff Tasmota 6.1.1.c. The log at Sonoff replay's
11:49:12 MQT: Verbinding mislukt naar 192.XXX.XXX.XXX:1883, rc -2. Opnieuw proberen over 10 sec
Could anyone help me with this problem?
Now that docker 1.12 supports health checks it would be great to see it added. I'm happy to do a PR if you want
The image seems to leak memory. Connecting 2 clients, but not sending traffic memory usage steadily increases from 20Mb to >800Mb over the course of an hour
For debugging purpose, it would be nice if the client tools would be available. They are included in the upstream repro. Thus, it would be easy to add them
Is there an easy way to start this container with an username and password for the broker connection configured? Let any security issues aside, i need that for testing. Thx.
The default mosquitto config does contain two logging statements.
Remove one and document accordingly.
I suggest to use only stdout as we are using docker.
Tested locally and it's a trivial change to start from a different base image:
FROM resin/rpi-raspbian
Happy to submit a merge request if it's something you want to support?
Provide an example how to migrate to the official Eclipse Mosquitto Container
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.