Docker 镜像 - 构建 RabbitMQ With Plugins

作者: Anoyi

2019-04-14 13:45

🏷 RabbitMQ 社区插件

🏷 示例安装插件 rabbitmq_delayed_message_exchange

插件 GITHUB 地址:https://github.com/rabbitmq/rabbitmq-delayed-message-exchange

1、在 社区插件 中下载 rabbitmq_delayed_message_exchange 到本地

2、解压后得到文件 rabbitmq_delayed_message_exchange-<time>-<version>.ez

3、编辑 Dockerfile

FROM rabbitmq:3.7-management

ADD rabbitmq_delayed_message_exchange-<time>-<version>.ez /opt/rabbitmq/plugins/

RUN rabbitmq-plugins enable rabbitmq_delayed_message_exchange

注意:rabbitmq_delayed_message_exchange-<time>-<version>.ez 以实际文件名为主

4、构建自定义的镜像

docker build -t rabbitmq:3.7-management-plugins .

5、测试插件是否生效

docker run -it --rm --hostname rabbit --name rabbit rabbitmq:3.7-management-plugins

日志输出如下即为生效:

.....
2019-04-14 05:18:03.006 [info] <0.8.0> Server startup complete; 4 plugins started.
 * rabbitmq_delayed_message_exchange
 * rabbitmq_management
 * rabbitmq_management_agent
 * rabbitmq_web_dispatch
 completed with 4 plugins.
评论

评论

昵称
邮箱