Skip to content

Commit

Permalink
Update Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
joesdu authored Oct 29, 2024
1 parent 114e994 commit 9a46434
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,25 @@
# 使用 rabbitmq:management 作为基础镜像,若是不需要管理页面可以使用rabbitmq:latest
FROM rabbitmq:4.0.3-management
FROM rabbitmq:latest

# 启用默认的 RabbitMQ 管理插件,同意若是不需要管理页面可以注释这行命令
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

Expand Down

0 comments on commit 9a46434

Please sign in to comment.