Giter Site home page Giter Site logo

toke / docker-mosquitto Goto Github PK

View Code? Open in Web Editor NEW
230.0 230.0 127.0 43 KB

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

Shell 2.07% Dockerfile 97.93%
docker mqtt

docker-mosquitto's Introduction

docker-mosquitto's People

Contributors

gavindekock avatar jonasheinisch avatar m0se avatar medined avatar onip avatar raphaelahrens avatar toke avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

docker-mosquitto's Issues

Add in a health check

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

Mosquitto logging permissions

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?

adduser in Dockerfile recommendation.

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.

  • Create the mosquitto user
  • Install mosquitto package.

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.

Memory leak

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

Support for docker on rasberry pi

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?

Sonoff couldn't connect to MQTT

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?

Add Client tools

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

Not able to ping containers within the same network.

Hi,

I have created 2 containers using the toke/mosquitto docker file. Both are running in the same network (not the default bridge, but in the user defined network called my_network)
When i try to ping the containers... it says ping : not found
Please have a look at it.

issue_ping

Failure to write to folder when loaded using 'run' instructions.

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.