1. 下载延时消息插件 rabbitmq_delayed_message_exchange-3.8.0.ez 下载地址
2. 创建Dcokerfile文件,内容如下
FROM rabbitmq:3.8-management
COPY ./rabbitmq_delayed_message_exchange-3.8.0.ez /plugins/
RUN rabbitmq-plugins enable rabbitmq_delayed_message_exchange
3. 将 rabbitmq_delayed_message_exchange-3.8.0.ez插件放到和Dockerfile同一目录,如下图
4. 执行docker build 命令进行构建镜像
docker build -t rabbitmq:3.8-management-delayed .
5. 运行镜像测试
docker run -d --name rabbitmq -e RABBITMQ_DEFAULT_USER=admin -e RABBITMQ_DEFAULT_PASS=123456 -p 15672:15672 -p 5672:5672 rabbitmq:3.8-management-delayed