How to add plugin to RabbitMQ docker image?

2019-06-26 00:04发布

问题:

I am using rabbitmq:3-management from https://hub.docker.com/_/rabbitmq/ however, it is missing a plugin that I need rabbitmq_delayed_message_exchange.

How can I enable this plugin if it is not available in the image?

回答1:

FROM rabbitmq:3.7-management

RUN apt-get update && \
apt-get install -y curl unzip

RUN curl https://dl.bintray.com/rabbitmq/community-plugins/3.7.x/rabbitmq_delayed_message_exchange/rabbitmq_delayed_message_exchange-20171201-3.7.x.zip > rabbitmq_delayed_message_exchange-20171201-3.7.x.zip && \
unzip rabbitmq_delayed_message_exchange-20171201-3.7.x.zip && \
rm -f rabbitmq_delayed_message_exchange-20171201-3.7.x.zip && \
mv rabbitmq_delayed_message_exchange-20171201-3.7.x.ez plugins/

RUN rabbitmq-plugins enable rabbitmq_delayed_message_exchange