专属域名
文档搜索
提交工单
轩辕助手
返回顶部
快速返回页面顶部
收起
收起工具栏
轩辕镜像
轩辕镜像专业版
个人中心搜索镜像
交易
充值流量我的订单
工具
提交工单镜像收录一键安装
Npm 源Pip 源
帮助
常见问题
其他
关于我们网站地图

官方QQ群: 13763429

轩辕镜像
镜像详情
...
efrecon/mosquitto
官方博客热门镜像提交工单
本站面向开发者与科研用户,提供开源镜像的搜索和下载加速服务。
所有镜像均来源于原始开源仓库,本站不存储、不修改、不传播任何镜像内容。
轩辕镜像 —— 国内开发者首选的专业 Docker 镜像加速平台。在线技术支持请优先 提交工单,技术交流欢迎加入官方QQ群:13763429 。
本站面向开发者与科研用户,提供开源镜像的搜索和下载加速服务。所有镜像均来源于原始开源仓库,本站不存储、不修改、不传播任何镜像内容。

mosquitto Docker 镜像下载 - 轩辕镜像

mosquitto 镜像详细信息和使用指南

mosquitto 镜像标签列表和版本信息

mosquitto 镜像拉取命令和加速下载

mosquitto 镜像使用说明和配置指南

Docker 镜像加速服务 - 轩辕镜像平台

国内开发者首选的 Docker 镜像加速平台

极速拉取 Docker 镜像服务

相关 Docker 镜像推荐

热门 Docker 镜像下载

mosquitto
efrecon/mosquitto
自动构建

mosquitto 镜像详细信息

mosquitto 镜像标签列表

mosquitto 镜像使用说明

mosquitto 镜像拉取命令

Docker 镜像加速服务

轩辕镜像平台优势

镜像下载指南

相关 Docker 镜像推荐

Easily configurable eclipse MQTT broker
2 收藏0 次下载activeefrecon镜像
🚀轩辕镜像专业版更稳定💎一键安装 Docker 配置镜像源
镜像简介版本下载
🚀轩辕镜像专业版更稳定💎一键安装 Docker 配置镜像源

mosquitto 镜像详细说明

mosquitto 使用指南

mosquitto 配置说明

mosquitto 官方文档

mosquitto

These Docker images (also at the GHCR) behave almost exactly as the official Eclipse mosquitto server images, while providing easy configuration of most parameters through environment variables. They are also ready for TLS connections using official root certificates out-of-the-box. Finally, whenever relevant files pointed at by the Mosquitto configuration change, this implementation will arrange for mosquitto to reload its configuration to take the changes into account.

Simpler Cases

For all known options present in the default configuration file, it is possible to set their value through creating an environment variable starting with MOSQUITTO_ and continuing with the same name as the option, but in upper case. So, for example, to change the retry interval to 10 seconds, an interval controlled by the configuration option retry_interval, you would set the variable MOSQUITTO_RETRY_INTERVAL to 10.

Sub-Sectioning

This simple heuristic will not work all the time, as Mosquitto divides configuration files into logical sub-sections and several options within these sub-sections share the same name. This image provides a workaround based on the fact that each sub-section is prefixed with a specific comment header in the default configuration file, a file that is made part of the original image upon which this image is based. The implementation is currently able to detect the following sections:

  • default will contain options for the default listener.
  • extra will contain options for an additional listener. There is currently no support for further listeners.
  • persistence will contain options for persistence.
  • logging will contain options for logging.
  • security will contain options for security, authorisations, ACLs, etc.
  • bridges will contain options for bridging mosquitto installations together for improved scalability.

For example, the content of the default section starts with the following header in the file (up to the next header):

configure
# =================================================================
# Default listener
# =================================================================

To start making use of this sectioning of the configuration file, you have to specify an include directory. This can be achieved using a configuration file with a given value for include_dir, or by specifying the environment variable MOSQUITTO_INCLUDE_DIR. Whenever the directory is specified, the main configuration file will be automatically sliced into a number of configuration files, named as described above and created in the include directory. A backup of the original configuration file will be made and a new configuration file where all sub-sections have been removed will be created.

In this context, it becomes possible to use specially crafted environment variables to address options in the different sub-sections. These variables should start with MOSQUITTO__ (note the double underscore), followed by the name of the section (as in the list above) in uppercase, followed by __ (two underscores again), followed by the name of the option in upper case. So, to specify a different port for the default listener, you could for example, set MOSQUITTO_INCLUDE_DIR to /mosquitto/config/sections/ to trigger this mechanism and then set MOSQUITTO__DEFAULT__PORT to 2883.

Note that while logical sections makes it easier to grasp the entire configuration, some of them are not entirely necessary. For example, the persistence section does not seem to have option names that *** with other sections. If you are sure about this, you can set variables directly using "single" underscores. Consequently, there are, for example two ways of turning on persistence:

  • You could set the variable MOSQUITTO_PERSISTENCE to true and set the variable MOSQUITTO_PERSISTENCE_LOCATION to /mosquitto/data/
  • You could also reason with sections and set the variables MOSQUITTO__PERSISTENCE__PERSISTENCE and MOSQUITTO__PERSISTENCE__PERSISTENCE_LOCATION, respectively.

In general, sub-sectioning is more deterministic.

Using from Compose

These images makes configuration much more visible (and flexible) from compose files whenever deploying mosquitto containers. Below is a somewhat constructed example:

yaml
volumes:
  persistence:
    driver: local

services:
  mosquitto:
    image: efrecon/mosquitto:1.5.5
    volumes:
      - persistence:/mosquitto/data
    environment:
      - MOSQUITTO_INCLUDE_DIR=/mosquitto/config/sections/
      - MOSQUITTO__PERSISTENCE__AUTOSAVE_ON_CHANGES=true
      - MOSQUITTO__PERSISTENCE__AUTOSAVE_INTERVAL=100
      - MOSQUITTO__PERSISTENCE__PERSISTENCE=true
      - MOSQUITTO__PERSISTENCE__PERSISTENCE_LOCATION=/mosquitto/data/
      - MOSQUITTO__LOGGING__LOG_DEST=stderr
    ports:
      -
        target: 1883
        published: 1883
        protocol: tcp
        mode: host
    logging:
      driver: "json-file"
      options:
        max-size: "1m"
        max-file: "10"
    deploy:
      restart_policy:
        delay: 10s
        max_attempts: 10
        window: 60s
      replicas: 1

Jumping into the container with docker exec would show a modified version of the regular configuration file at /mosquitto/config/mosquitto.conf and several configuration files in the directory /mosquitto/config/sections/, one for each of the sections supported by this implementation.

Complex Cases

For even more complex cases, you will have to provide your own configuration file by hand. If this is the case, there is probably little point in preferring this image over the official Eclipse image. However, you might still want to mix behaviours. As long as you provide a configuration that contains the same sections (in comments) as the original configuration file, you should be able to benefit from this implementation. Note that the entrypoint requires the file to be located at /mosquitto/config/mosquitto.conf.

Security

Secrets

For security reasons, you would probably not want to expose the value of secrets using environment variables. A possible workaround is to copy the default configuration file inside your own project, modify sensitive data in the file and mount it/copy it into the container. As long as your copy keeps track of all possible options and their default values as lines that are commented away, you would still be able to tune the configuration externally as explained in the previous paragraph. Note that most secret information in mosquitto is offloaded to other files than the main configuration file, so in most cases you will be safe to point at these files through environment variables; while still making sure that the files containing secret information are present within the container.

TLS

In order to provide TLS encryption, you will have to add an extra listener to mosquitto. Provided you have official key and cert for a host, you could place them in a volume (tls in the example below) and adapt the following compose file:

yaml
volumes:
  persistence:
    driver: local
  tls:
    driver: local

services:
  mosquitto:
    image: efrecon/mosquitto:1.5.5
    volumes:
      - persistence:/mosquitto/data
      - tls:/mosquitto/config/security
    environment:
      - MOSQUITTO_INCLUDE_DIR=/mosquitto/config/sections/
      - MOSQUITTO__PERSISTENCE__AUTOSAVE_ON_CHANGES=true
      - MOSQUITTO__PERSISTENCE__AUTOSAVE_INTERVAL=100
      - MOSQUITTO__PERSISTENCE__PERSISTENCE=true
      - MOSQUITTO__PERSISTENCE__PERSISTENCE_LOCATION=/mosquitto/data/
      - MOSQUITTO__LOGGING__LOG_DEST=stderr
      - MOSQUITTO__EXTRA__LISTENER=8883
      - MOSQUITTO__EXTRA__CAPATH=/etc/ssl/certs/
      - MOSQUITTO__EXTRA__KEYFILE=/mosquitto/config/security/yourhostname.key
      - MOSQUITTO__EXTRA__CERTFILE=/mosquitto/config/security/yourhostname.crt
    ports:
      -
        target: 8883
        published: 8883
        protocol: tcp
        mode: host
    logging:
      driver: "json-file"
      options:
        max-size: "1m"
        max-file: "10"
    deploy:
      restart_policy:
        delay: 10s
        max_attempts: 10
        window: 60s
      replicas: 1

This can be combined with an auto-renewing reverse proxy such as caddy to protect access to your mosquitto container using certificates from Let's Encrypt. You will then have to share the volume where caddy stores handshaked certificates with your mosquitto container and adapt the path to access the key and certificate.

Configuring the Entrypoint

The entrypoint itself can be configured either by command-line options, or through environment variables, all starting with MQ_. Command-line options have precedence over environment variables. The image default is to provide feedback about the transformations applied by this implementation through setting the --verbose flag.

Reloading

When running with sectioning, which is triggered by setting the environment variable MOSQUITTO_INCLUDE_DIR or setting the configuration parameter include_dir, this implementation is able to detect changes in files that are pointed at by the configuration, e.g. password file, server certificate or key, etc. This is controlled by the command-line option --watcher to the entrypoint (or the environment variable MQ_WATCHER); a good default that should work in most cases is provided.

The implementation will look into the sectioned configuration files for the values of known configuration parameters and, for each, start a process that will watch the file pointed at by the parameter for changes. When the file changes, the SIGHUP process is sent to mosquitto, which will then reload its configuration (see section about signals in the manual).

File watching is implemented using watch.sh, signalling using signal.sh. The signalling implementation will actively look for a probable process if the PID file does not exist.

Automated Builds

Builds will happen automatically for all current and future versions of the official images by the way of the scripts in the hooks directory. This means that versioning and tagging of these images will match the official Docker library. Currently, version discovery is based on reg-tags, a shell library present as a submodule to this repository.

Implementation

All substitution and slicing occurs from docker-entrypoint.sh. Substitution in the various configuration files occurs at the shell level. Slicing the main configuration file into sub-sections required a more complex algorithm and is implemented in the Tcl script slicer.tcl. The script is called twice, once for detecting the location of the include directory, and a second time to create the various sub-section files.

Configuration of the entrypoint can occur through environment variables starting with MQ_. The value of these variables is also used in the processes that are started from the entrypoint to watch relevant files for changes. The entire process tree forming the implementation is placed under the control of tini to ease garbage collection of processes when containers are killed or stopped.

查看更多 mosquitto 相关镜像 →
eclipse/mosquitto logo
eclipse/mosquitto
by The Eclipse Foundation
DEPRECATED REPOSITORY: CONSIDER USING https://hub.docker.com/_/eclipse-mosquitto
11100K+ pulls
上次更新:9 年前

用户好评

来自真实用户的反馈,见证轩辕镜像的优质服务

oldzhang的头像

oldzhang

运维工程师

Linux服务器

5

"Docker加速体验非常流畅,大镜像也能快速完成下载。"

用户评价详情

oldzhang - 运维工程师

Linux服务器

5

Docker加速体验非常流畅,大镜像也能快速完成下载。

Nana - 后端开发

Mac桌面

4.9

配置Docker镜像源后,拉取速度快了数倍,开发体验提升明显。

Qiang - 平台研发

K8s集群

5

轩辕镜像在K8s集群中表现很稳定,容器部署速度明显加快。

小敏 - 测试工程师

Windows桌面

4.8

Docker镜像下载不再超时,测试环境搭建更加高效。

晨曦 - DevOps工程师

宝塔面板

5

配置简单,Docker镜像源稳定,适合快速部署环境。

阿峰 - 资深开发

群晖NAS

5

在群晖NAS上配置后,镜像下载速度飞快,非常适合家庭实验环境。

俊仔 - 后端工程师

飞牛NAS

4.9

Docker加速让容器搭建顺畅无比,再也不用等待漫长的下载。

Lily - 测试经理

Linux服务器

4.8

镜像源覆盖面广,更新及时,团队一致反馈体验不错。

浩子 - 云平台工程师

Podman容器

5

使用轩辕镜像后,Podman拉取镜像稳定无比,生产环境可靠。

Kai - 运维主管

爱快路由

5

爱快系统下配置加速服务,Docker镜像拉取速度提升非常大。

翔子 - 安全工程师

Linux服务器

4.9

镜像源稳定性高,安全合规,Docker拉取无忧。

亮哥 - 架构师

K8s containerd

5

大规模K8s集群下镜像加速效果显著,节省了大量时间。

慧慧 - 平台开发

Docker Compose

4.9

配置Compose镜像加速后,整体构建速度更快了。

Tina - 技术支持

Windows桌面

4.8

配置简单,镜像拉取稳定,适合日常开发环境。

宇哥 - DevOps Leader

极空间NAS

5

在极空间NAS上使用Docker加速,体验流畅稳定。

小静 - 数据工程师

Linux服务器

4.9

Docker镜像源下载速度快,大数据环境搭建轻松完成。

磊子 - SRE

宝塔面板

5

使用轩辕镜像后,CI/CD流程整体快了很多,值得推荐。

阿Yang - 前端开发

Mac桌面

4.9

国内网络环境下,Docker加速非常给力,前端环境轻松搭建。

Docker迷 - 架构师

威联通NAS

5

威联通NAS下配置镜像加速后,Docker体验比官方源好很多。

方宇 - 系统工程师

绿联NAS

5

绿联NAS支持加速配置,Docker镜像下载快且稳定。

常见问题

Q1:轩辕镜像免费版与专业版有什么区别?

免费版仅支持 Docker Hub 加速,不承诺可用性和速度;专业版支持更多镜像源,保证可用性和稳定速度,提供优先客服响应。

Q2:轩辕镜像免费版与专业版有分别支持哪些镜像?

免费版仅支持 docker.io;专业版支持 docker.io、gcr.io、ghcr.io、registry.k8s.io、nvcr.io、quay.io、mcr.microsoft.com、docker.elastic.co 等。

Q3:流量耗尽错误提示

当返回 402 Payment Required 错误时,表示流量已耗尽,需要充值流量包以恢复服务。

Q4:410 错误问题

通常由 Docker 版本过低导致,需要升级到 20.x 或更高版本以支持 V2 协议。

Q5:manifest unknown 错误

先检查 Docker 版本,版本过低则升级;版本正常则验证镜像信息是否正确。

Q6:镜像拉取成功后,如何去掉轩辕镜像域名前缀?

使用 docker tag 命令为镜像打上新标签,去掉域名前缀,使镜像名称更简洁。

查看全部问题→

轩辕镜像下载加速使用手册

探索更多轩辕镜像的使用方法,找到最适合您系统的配置方式

登录仓库拉取

通过 Docker 登录认证访问私有仓库

Linux

在 Linux 系统配置镜像加速服务

Windows/Mac

在 Docker Desktop 配置镜像加速

Docker Compose

Docker Compose 项目配置加速

K8s Containerd

Kubernetes 集群配置 Containerd

宝塔面板

在宝塔面板一键配置镜像加速

群晖

Synology 群晖 NAS 配置加速

飞牛

飞牛 fnOS 系统配置镜像加速

极空间

极空间 NAS 系统配置加速服务

爱快路由

爱快 iKuai 路由系统配置加速

绿联

绿联 NAS 系统配置镜像加速

威联通

QNAP 威联通 NAS 配置加速

Podman

Podman 容器引擎配置加速

Singularity/Apptainer

HPC 科学计算容器配置加速

其他仓库配置

ghcr、Quay、nvcr 等镜像仓库

专属域名拉取

无需登录使用专属域名加速

需要其他帮助?请查看我们的 常见问题 或 官方QQ群: 13763429

商务:17300950906
©2024-2025 源码跳动
商务合作电话:17300950906Copyright © 2024-2025 杭州源码跳动科技有限公司. All rights reserved.