Skip to content

Commit 3e3d197

Browse files
committed
Fix ownership of management_agent.disable_metrics_collector.conf and enabled_plugins files
1 parent 28b08a0 commit 3e3d197

File tree

6 files changed

+18
-12
lines changed

6 files changed

+18
-12
lines changed

3.8-rc/alpine/Dockerfile

Lines changed: 3 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

3.8-rc/ubuntu/Dockerfile

Lines changed: 3 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

3.8/alpine/Dockerfile

Lines changed: 3 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

3.8/ubuntu/Dockerfile

Lines changed: 3 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Dockerfile-alpine.template

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -252,8 +252,9 @@ RUN set -eux; \
252252

253253
# Enable Prometheus-style metrics by default (https://github.com/docker-library/rabbitmq/issues/419)
254254
RUN set -eux; \
255-
rabbitmq-plugins enable --offline rabbitmq_prometheus; \
256-
echo 'management_agent.disable_metrics_collector = true' > /etc/rabbitmq/conf.d/management_agent.disable_metrics_collector.conf
255+
su-exec rabbitmq rabbitmq-plugins enable --offline rabbitmq_prometheus; \
256+
echo 'management_agent.disable_metrics_collector = true' > /etc/rabbitmq/conf.d/management_agent.disable_metrics_collector.conf; \
257+
chown rabbitmq:rabbitmq /etc/rabbitmq/conf.d/management_agent.disable_metrics_collector.conf
257258

258259
# Added for backwards compatibility - users can simply COPY custom plugins to /plugins
259260
RUN ln -sf /opt/rabbitmq/plugins /plugins

Dockerfile-ubuntu.template

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -270,8 +270,9 @@ RUN set -eux; \
270270

271271
# Enable Prometheus-style metrics by default (https://github.com/docker-library/rabbitmq/issues/419)
272272
RUN set -eux; \
273-
rabbitmq-plugins enable --offline rabbitmq_prometheus; \
274-
echo 'management_agent.disable_metrics_collector = true' > /etc/rabbitmq/conf.d/management_agent.disable_metrics_collector.conf
273+
gosu rabbitmq rabbitmq-plugins enable --offline rabbitmq_prometheus; \
274+
echo 'management_agent.disable_metrics_collector = true' > /etc/rabbitmq/conf.d/management_agent.disable_metrics_collector.conf; \
275+
chown rabbitmq:rabbitmq /etc/rabbitmq/conf.d/management_agent.disable_metrics_collector.conf
275276

276277
# Added for backwards compatibility - users can simply COPY custom plugins to /plugins
277278
RUN ln -sf /opt/rabbitmq/plugins /plugins

0 commit comments

Comments
 (0)