Skip to content

Use conf.d to enable console logging in RMQ 3.9+ #555

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 22, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions 10-default-guest-user.conf → 10-defaults.conf
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,7 @@
## https://www.rabbitmq.com/access-control.html#loopback-users
## https://www.rabbitmq.com/production-checklist.html#users
loopback_users.guest = false

## Send all logs to stdout/TTY. Necessary to see logs when running via
## a container
log.console = true

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 3 additions & 4 deletions 3.10-rc/alpine/Dockerfile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 3 additions & 4 deletions 3.10-rc/ubuntu/Dockerfile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 3 additions & 4 deletions 3.9/alpine/Dockerfile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 0 additions & 8 deletions 3.9/ubuntu/10-default-guest-user.conf

This file was deleted.

12 changes: 12 additions & 0 deletions 3.9/ubuntu/10-defaults.conf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 3 additions & 4 deletions 3.9/ubuntu/Dockerfile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 7 additions & 1 deletion Dockerfile-alpine.template
Original file line number Diff line number Diff line change
Expand Up @@ -211,9 +211,15 @@ ENV RABBITMQ_VERSION {{ .version }}
ENV RABBITMQ_PGP_KEY_ID="0x0A9AF2115F4687BD29803A206B73A36E6026DFCA"
ENV RABBITMQ_HOME=/opt/rabbitmq

{{ if ([ "3.8", "3.8-rc" ] | index(env.version)) then ( -}}
# Add RabbitMQ to PATH, send all logs to TTY
ENV PATH=$RABBITMQ_HOME/sbin:$PATH \
RABBITMQ_LOGS=-
{{ )
else ( -}}
# Add RabbitMQ to PATH
ENV PATH=$RABBITMQ_HOME/sbin:$PATH
{{ ) end -}}

# Install RabbitMQ
RUN set -eux; \
Expand Down Expand Up @@ -276,7 +282,7 @@ VOLUME $RABBITMQ_DATA_DIR
ENV LANG=C.UTF-8 LANGUAGE=C.UTF-8 LC_ALL=C.UTF-8

{{ if ([ "3.8", "3.8-rc" ] | index(env.version)) then "" else ( -}}
COPY --chown=rabbitmq:rabbitmq 10-default-guest-user.conf /etc/rabbitmq/conf.d/
COPY --chown=rabbitmq:rabbitmq 10-defaults.conf /etc/rabbitmq/conf.d/
{{ ) end -}}
COPY docker-entrypoint.sh /usr/local/bin/
ENTRYPOINT ["docker-entrypoint.sh"]
Expand Down
8 changes: 7 additions & 1 deletion Dockerfile-ubuntu.template
Original file line number Diff line number Diff line change
Expand Up @@ -222,9 +222,15 @@ ENV RABBITMQ_VERSION {{ .version }}
ENV RABBITMQ_PGP_KEY_ID="0x0A9AF2115F4687BD29803A206B73A36E6026DFCA"
ENV RABBITMQ_HOME=/opt/rabbitmq

{{ if ([ "3.8", "3.8-rc" ] | index(env.version)) then ( -}}
# Add RabbitMQ to PATH, send all logs to TTY
ENV PATH=$RABBITMQ_HOME/sbin:$PATH \
RABBITMQ_LOGS=-
{{ )
else ( -}}
# Add RabbitMQ to PATH
ENV PATH=$RABBITMQ_HOME/sbin:$PATH
{{ ) end -}}

# Install RabbitMQ
RUN set -eux; \
Expand Down Expand Up @@ -294,7 +300,7 @@ VOLUME $RABBITMQ_DATA_DIR
ENV LANG=C.UTF-8 LANGUAGE=C.UTF-8 LC_ALL=C.UTF-8

{{ if ([ "3.8", "3.8-rc" ] | index(env.version)) then "" else ( -}}
COPY --chown=rabbitmq:rabbitmq 10-default-guest-user.conf /etc/rabbitmq/conf.d/
COPY --chown=rabbitmq:rabbitmq 10-defaults.conf /etc/rabbitmq/conf.d/
{{ ) end -}}
COPY docker-entrypoint.sh /usr/local/bin/
ENTRYPOINT ["docker-entrypoint.sh"]
Expand Down
2 changes: 1 addition & 1 deletion apply-templates.sh
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ for version; do
cp -a "$entrypoint" "$version/$variant/docker-entrypoint.sh"

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

if [ "$variant" = 'alpine' ]; then
Expand Down