Skip to content

Commit a1017df

Browse files
committed
simplify 3
1 parent 4da5729 commit a1017df

File tree

1 file changed

+5
-24
lines changed

1 file changed

+5
-24
lines changed

packaging/docker-image/Dockerfile

+5-24
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@ ARG OTP_VERSION="27"
22

33
FROM erlang:${OTP_VERSION}
44

5-
ARG BUILDKIT_SBOM_SCAN_STAGE=true
6-
75
ENV RABBITMQ_DATA_DIR /var/lib/rabbitmq
86

97
RUN set -eux; \
@@ -17,7 +15,7 @@ RUN set -eux; \
1715

1816
# Use the latest stable RabbitMQ release (https://www.rabbitmq.com/download.html)
1917
ARG RABBITMQ_VERSION=4.0.0
20-
ENV RABBITMQ_VERSION=${RABBITMQ_VERSION}
18+
ENV RABBITMQ_VERSION ${RABBITMQ_VERSION}
2119
ENV RABBITMQ_HOME /opt/rabbitmq
2220

2321
# Add RabbitMQ to PATH
@@ -31,16 +29,7 @@ RUN set -eux; \
3129
apt-get update; \
3230
apt-get install --yes --no-install-recommends \
3331
ca-certificates \
34-
# grab gosu for easy step-down from root
35-
gosu \
36-
# Bring in tzdata so users could set the timezones through the environment
3732
tzdata \
38-
; \
39-
# verify that the "gosu" binary works
40-
gosu nobody true; \
41-
\
42-
savedAptMark="$(apt-mark showmanual)"; \
43-
apt-get install --yes --no-install-recommends \
4433
gnupg \
4534
wget \
4635
xz-utils \
@@ -60,17 +49,7 @@ RUN set -eux; \
6049
\
6150
apt-mark auto '.*' > /dev/null; \
6251
apt-mark manual $savedAptMark; \
63-
apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \
64-
\
65-
# verify assumption of no stale cookies
66-
[ ! -e "$RABBITMQ_DATA_DIR/.erlang.cookie" ]; \
67-
# Ensure RabbitMQ was installed correctly by running a few commands that do not depend on a running server, as the rabbitmq user
68-
# If they all succeed, it's safe to assume that things have been set up correctly
69-
gosu rabbitmq rabbitmqctl help; \
70-
gosu rabbitmq rabbitmqctl list_ciphers; \
71-
gosu rabbitmq rabbitmq-plugins list; \
72-
# no stale cookies
73-
rm "$RABBITMQ_DATA_DIR/.erlang.cookie";
52+
apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false;
7453

7554
# set home so that any `--user` knows where to put the erlang cookie
7655
ENV HOME $RABBITMQ_DATA_DIR
@@ -80,7 +59,9 @@ VOLUME $RABBITMQ_DATA_DIR
8059
# warning: the VM is running with native name encoding of latin1 which may cause Elixir to malfunction as it expects utf8. Please ensure your locale is set to UTF-8 (which can be verified by running "locale" in your shell)
8160
# Setting all environment variables that control language preferences, behaviour differs - https://www.gnu.org/software/gettext/manual/html_node/The-LANGUAGE-variable.html#The-LANGUAGE-variable
8261
# https://docs.docker.com/samples/library/ubuntu/#locales
83-
ENV LANG=C.UTF-8 LANGUAGE=C.UTF-8 LC_ALL=C.UTF-8
62+
ENV LANG C.UTF-8
63+
ENV LANGUAGE C.UTF-8
64+
ENV LC_ALL=C.UTF-8
8465

8566
COPY --chown=rabbitmq:rabbitmq 10-defaults.conf 20-management_agent.disable_metrics_collector.conf /etc/rabbitmq/conf.d/
8667
COPY docker-entrypoint.sh /usr/local/bin/

0 commit comments

Comments
 (0)