Skip to content

Commit 3e8f0f1

Browse files
committed
Use conf.d to enable console logging in RMQ 3.9+
This replaces the `RABBITMQ_LOGS=-` env variable. Fixes #554
1 parent 99fffd5 commit 3e8f0f1

13 files changed

+55
-27
lines changed

10-default-guest-user.conf renamed to 10-defaults.conf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,7 @@
66
## https://www.rabbitmq.com/access-control.html#loopback-users
77
## https://www.rabbitmq.com/production-checklist.html#users
88
loopback_users.guest = false
9+
10+
## Send all logs to stdout/TTY. Necessary to see logs when running via
11+
## a container
12+
log.console = true

3.10-rc/alpine/10-default-guest-user.conf renamed to 3.10-rc/alpine/10-defaults.conf

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

3.10-rc/alpine/Dockerfile

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

3.10-rc/ubuntu/10-default-guest-user.conf renamed to 3.10-rc/ubuntu/10-defaults.conf

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

3.10-rc/ubuntu/Dockerfile

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

3.9/alpine/10-default-guest-user.conf renamed to 3.9/alpine/10-defaults.conf

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

3.9/alpine/Dockerfile

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

3.9/ubuntu/10-default-guest-user.conf

Lines changed: 0 additions & 8 deletions
This file was deleted.

3.9/ubuntu/10-defaults.conf

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

3.9/ubuntu/Dockerfile

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

Dockerfile-alpine.template

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,9 +211,15 @@ ENV RABBITMQ_VERSION {{ .version }}
211211
ENV RABBITMQ_PGP_KEY_ID="0x0A9AF2115F4687BD29803A206B73A36E6026DFCA"
212212
ENV RABBITMQ_HOME=/opt/rabbitmq
213213

214+
{{ if ([ "3.8", "3.8-rc" ] | index(env.version)) then ( -}}
214215
# Add RabbitMQ to PATH, send all logs to TTY
215216
ENV PATH=$RABBITMQ_HOME/sbin:$PATH \
216217
RABBITMQ_LOGS=-
218+
{{ )
219+
else ( -}}
220+
# Add RabbitMQ to PATH
221+
ENV PATH=$RABBITMQ_HOME/sbin:$PATH
222+
{{ ) end -}}
217223

218224
# Install RabbitMQ
219225
RUN set -eux; \
@@ -276,7 +282,7 @@ VOLUME $RABBITMQ_DATA_DIR
276282
ENV LANG=C.UTF-8 LANGUAGE=C.UTF-8 LC_ALL=C.UTF-8
277283

278284
{{ if ([ "3.8", "3.8-rc" ] | index(env.version)) then "" else ( -}}
279-
COPY --chown=rabbitmq:rabbitmq 10-default-guest-user.conf /etc/rabbitmq/conf.d/
285+
COPY --chown=rabbitmq:rabbitmq 10-defaults.conf /etc/rabbitmq/conf.d/
280286
{{ ) end -}}
281287
COPY docker-entrypoint.sh /usr/local/bin/
282288
ENTRYPOINT ["docker-entrypoint.sh"]

Dockerfile-ubuntu.template

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,9 +222,15 @@ ENV RABBITMQ_VERSION {{ .version }}
222222
ENV RABBITMQ_PGP_KEY_ID="0x0A9AF2115F4687BD29803A206B73A36E6026DFCA"
223223
ENV RABBITMQ_HOME=/opt/rabbitmq
224224

225+
{{ if ([ "3.8", "3.8-rc" ] | index(env.version)) then ( -}}
225226
# Add RabbitMQ to PATH, send all logs to TTY
226227
ENV PATH=$RABBITMQ_HOME/sbin:$PATH \
227228
RABBITMQ_LOGS=-
229+
{{ )
230+
else ( -}}
231+
# Add RabbitMQ to PATH
232+
ENV PATH=$RABBITMQ_HOME/sbin:$PATH
233+
{{ ) end -}}
228234

229235
# Install RabbitMQ
230236
RUN set -eux; \
@@ -294,7 +300,7 @@ VOLUME $RABBITMQ_DATA_DIR
294300
ENV LANG=C.UTF-8 LANGUAGE=C.UTF-8 LC_ALL=C.UTF-8
295301

296302
{{ if ([ "3.8", "3.8-rc" ] | index(env.version)) then "" else ( -}}
297-
COPY --chown=rabbitmq:rabbitmq 10-default-guest-user.conf /etc/rabbitmq/conf.d/
303+
COPY --chown=rabbitmq:rabbitmq 10-defaults.conf /etc/rabbitmq/conf.d/
298304
{{ ) end -}}
299305
COPY docker-entrypoint.sh /usr/local/bin/
300306
ENTRYPOINT ["docker-entrypoint.sh"]

apply-templates.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ for version; do
5555
cp -a "$entrypoint" "$version/$variant/docker-entrypoint.sh"
5656

5757
if [ "$rcVersion" != '3.8' ]; then
58-
cp 10-default-guest-user.conf "$version/$variant/"
58+
cp 10-defaults.conf "$version/$variant/"
5959
fi
6060

6161
if [ "$variant" = 'alpine' ]; then

0 commit comments

Comments
 (0)