From 9a46434a443c9d9446718189b72ee556f0b0f9dd Mon Sep 17 00:00:00 2001 From: Joe Du <13188169+joesdu@users.noreply.github.com> Date: Tue, 29 Oct 2024 13:12:19 +0800 Subject: [PATCH] Update Dockerfile --- Dockerfile | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index e1d71d0..60694b6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ # 使用 rabbitmq:management 作为基础镜像,若是不需要管理页面可以使用rabbitmq:latest -FROM rabbitmq:4.0.3-management +FROM rabbitmq:latest # 启用默认的 RabbitMQ 管理插件,同意若是不需要管理页面可以注释这行命令 RUN rabbitmq-plugins enable rabbitmq_management @@ -7,6 +7,19 @@ RUN rabbitmq-plugins enable rabbitmq_management # 添加插件到指定目录(可按照此方式自行扩展其他插件) ADD ./rabbitmq_delayed_message_exchange-*.ez /plugins +RUN set -eux; \ + rabbitmq-plugins enable --offline rabbitmq_management; \ +# make sure the metrics collector is re-enabled (disabled in the base image for Prometheus-style metrics by default) + rm -f /etc/rabbitmq/conf.d/20-management_agent.disable_metrics_collector.conf; \ +# grab "rabbitmqadmin" from inside the "rabbitmq_management-X.Y.Z" plugin folder +# see https://github.com/docker-library/rabbitmq/issues/207 + cp /plugins/rabbitmq_management-*/priv/www/cli/rabbitmqadmin /usr/local/bin/rabbitmqadmin; \ + [ -s /usr/local/bin/rabbitmqadmin ]; \ + chmod +x /usr/local/bin/rabbitmqadmin; \ + apt-get update; \ + apt-get install -y --no-install-recommends python3; \ + rm -rf /var/lib/apt/lists/*; \ + rabbitmqadmin --version # 开启延迟队列插件 RUN rabbitmq-plugins enable rabbitmq_delayed_message_exchange