This container image contains the Mosquitto MQTT broker and client tools installed from EPEL repositories.
Additional information to keep in mind
mosquitto.conf file./etc/mosquitto/mosquitto.conf location:
docker ... -v mosquitto.conf:/etc/mosquitto/mosquitto.conf ...
mosquitto.conf file:
persistence true
persistence_location /mosquitto/data/
/mosquitto/data/ directory to the host filesystem:
docker ... -v mosquitto-data:/mosquitto/data ...
By default, mosquitto logs are captured/written to standard system logs (systemd
journal). You can change this behavior by adding the following line to the
mosquitto.conf file:
log_dest file DEST
You can use the previously mentioned /mosquitto/ directory to store logs. For example:
log_dest file /mosquitto/log/mosquitto.log
Packaged mosquitto also has access to /var/log/mosquitto directory so you can use it as well:
log_dest file /var/log/mosquitto/mosquitto.log
Note that only one log destination can be used at a time.
Then, you can start the container with the following option:
docker ... -v mosquitto-log:/mosquitto/log ...
or similar package default:
docker ... -v mosquitto-log:/var/log/mosquitto ...
To run a temporary container with default configuration, execute the following command:
docker run --rm --name el9-mosquitto -p 1883:1883 sourcemation/mosquitto:latest
The /mosquito/logs and /mosquito/data directories were added, and the
proper permissions were set for ease of modification. It’s similar to the
Eclipse Foundation Original image except for the standard configuration
residing in the /etc/mosquito/mosquito.conf instead of
/mosquito/config/mosquitto.conf
To run the container with custom configuration, logging and data persistence properly configured, execute the following command:
docker run --name el9-mosquitto -p 1883:1883 -v mosquitto.conf:/etc/mosquitto/mosquitto.conf -v DATA_PATH:/mosquitto/data -v LOG_PATH:/mosquitto/log sourcemation/mosquitto:latest
Where mosquitto.conf is your custom configuration file, DATA_PATH is the
path to the directory where you want to store mosquitto data and, LOG_PATH is
the path to the directory where you want to store mosquitto logs.
Example custom configuration file:
persistence true
persistence_location /mosquitto/data/
log_dest file /mosquitto/log/mosquitto.log
# Log types = debug, error, warning, notice, information, none, subscribe, unsubscribe, websockets, all
log_type information
log_type notice
log_type subscribe
log_type unsubscribe
log_type warning
log_type error
Please note that you can override the default configuration file located at
/etc/mosquitto/mosquitto.conf by mounting your own configuration file at this
location with -v option like this:
docker ... -v mosquitto.conf:/mosquitto/config/mosquitto.conf ...
Lastly by adding the -d option you can run the container in the background.
docker run -d --name el9-mosquitto ...
This image uses the following environment variables:
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
APP_VERSION="XXX - set during build"
APP_NAME="mosquitto"
This image exposes the following ports:
Please note that the ports need to be either manually forwarded with the -p
option, like in the examples above, or let Docker choose some for you with the
-P option.
We welcome your contributions! If you have new feature requests, want to report a bug, or wish to submit a pull request with your code or an image request, you can do so via the Sourcemation GitHub repository for this image.
Disclaimer: The sourcemation/mosquitto image is not affiliated with the
The Eclipse Foundation. The respective companies and organisations own the
trademarks mentioned in the offering. The sourcemation/mosquitto image is a
separate project and is maintained by Sourcemation.
mosquitto with UID/GID 984:985mosquitto user. It will also not create these directories even if
proper permissions on parent directories are set. If you want to use
directories different from the one provided in this short guide, you must
create them manually and set proper permissions.9001 port, which requires additional
configuration to work properly (it's not mentioned in their image guide)./etc/mosquitto/mosquitto.conf.A detailed risk analysis report of the image and its components can be found on the Sourcemation platform.
For more information, check out the official Mosquitto website.
The base licenses for the solution (Eclipse Mosquitto) are the Eclipse Public License 2.0 and the Eclipse Distribution License 1.0. The licenses for each component shipped as part of this image can be found on the image's appropriate Sourcemation entry.
Content type
Image
Digest
sha256:275c3c6ad…
Size
80.8 MB
Last updated
about 14 hours ago
docker pull sourcemation/mosquitto