Skip to content

Commit fa5366c

Browse files
committed
Apply templates plus simplification
- adjust 3.9 fragments to a single file - use jq template instead of seding the Dockerfile for the COPY
1 parent bd6cc65 commit fa5366c

9 files changed

+30
-11
lines changed

conf.d/10-default-user.conf renamed to 10-default-guest-user.conf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## DEFAULT SETTINGS ARE NOT MEANT TO BE TAKEN STRAIGHT INTO PRODUCTION
2+
## see https://www.rabbitmq.com/configure.html for further information
3+
## on configuring RabbitMQ
4+
15
## allow access to the guest user from anywhere on the network
26
## https://www.rabbitmq.com/access-control.html#loopback-users
37
## https://www.rabbitmq.com/production-checklist.html#users
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
## DEFAULT SETTINGS ARE NOT MEANT TO BE TAKEN STRAIGHT INTO PRODUCTION
2+
## see https://www.rabbitmq.com/configure.html for further information
3+
## on configuring RabbitMQ
4+
5+
## allow access to the guest user from anywhere on the network
6+
## https://www.rabbitmq.com/access-control.html#loopback-users
7+
## https://www.rabbitmq.com/production-checklist.html#users
8+
loopback_users.guest = false

3.9-rc/alpine/Dockerfile

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
## DEFAULT SETTINGS ARE NOT MEANT TO BE TAKEN STRAIGHT INTO PRODUCTION
2+
## see https://www.rabbitmq.com/configure.html for further information
3+
## on configuring RabbitMQ
4+
5+
## allow access to the guest user from anywhere on the network
6+
## https://www.rabbitmq.com/access-control.html#loopback-users
7+
## https://www.rabbitmq.com/production-checklist.html#users
8+
loopback_users.guest = false

3.9-rc/ubuntu/Dockerfile

Lines changed: 1 addition & 0 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
@@ -270,8 +270,9 @@ VOLUME $RABBITMQ_DATA_DIR
270270
# https://docs.docker.com/samples/library/ubuntu/#locales
271271
ENV LANG=C.UTF-8 LANGUAGE=C.UTF-8 LC_ALL=C.UTF-8
272272

273-
COPY conf.d /etc/rabbitmq/
274-
273+
{{ if ([ "3.8", "3.8-rc" ] | index(env.version)) then "" else ( -}}
274+
COPY --chown=rabbitmq:rabbitmq 10-default-guest-user.conf /etc/rabbitmq/conf.d/
275+
{{ ) end -}}
275276
COPY docker-entrypoint.sh /usr/local/bin/
276277
ENTRYPOINT ["docker-entrypoint.sh"]
277278

Dockerfile-ubuntu.template

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -288,8 +288,9 @@ VOLUME $RABBITMQ_DATA_DIR
288288
# https://docs.docker.com/samples/library/ubuntu/#locales
289289
ENV LANG=C.UTF-8 LANGUAGE=C.UTF-8 LC_ALL=C.UTF-8
290290

291-
COPY conf.d /etc/rabbitmq/
292-
291+
{{ if ([ "3.8", "3.8-rc" ] | index(env.version)) then "" else ( -}}
292+
COPY --chown=rabbitmq:rabbitmq 10-default-guest-user.conf /etc/rabbitmq/conf.d/
293+
{{ ) end -}}
293294
COPY docker-entrypoint.sh /usr/local/bin/
294295
ENTRYPOINT ["docker-entrypoint.sh"]
295296

apply-templates.sh

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,8 @@ for version; do
4848
fi
4949
cp -a "$entrypoint" "$version/$variant/docker-entrypoint.sh"
5050

51-
if [ "$rcVersion" = '3.8' ]; then
52-
sed -i -e '/COPY conf.d/d' "$version/$variant/Dockerfile"
53-
else
54-
cp -aR "conf.d" "$version/$variant/"
51+
if [ "$rcVersion" != '3.8' ]; then
52+
cp 10-default-guest-user.conf "$version/$variant/"
5553
fi
5654

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

conf.d/01-preamble.conf

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

0 commit comments

Comments
 (0)