-
Notifications
You must be signed in to change notification settings - Fork 426
Expand file tree
/
Copy pathDockerfile-management.template
More file actions
78 lines (74 loc) · 2.66 KB
/
Dockerfile-management.template
File metadata and controls
78 lines (74 loc) · 2.66 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
# vim:noet:
FROM {{
"rabbitmq:" + env.version
+ if env.variant == "alpine" then "-alpine" else "" end
}}
RUN set -eux; \
rabbitmq-plugins enable --offline rabbitmq_management; \
# make sure the metrics collector is re-enabled (disabled in the base image for Prometheus-style metrics by default)
rm -f /etc/rabbitmq/conf.d/20-management_agent.disable_metrics_collector.conf
{{ if env.variant == "alpine" then ( -}}
RUN set -eux; \
arch="$(apk --print-arch)"; \
\
case "$arch" in \
{{ .rabbitmqadmin.arches | to_entries | map( -}}
{{ def alpine_arches: {
"alpine-amd64": "x86_64",
"alpine-arm64v8": "aarch64",
} -}}
{{ alpine_arches[.key] // empty | @sh }}) url={{ .value.url | @sh }}; digest={{ .value.digest | @sh }} ;; \
{{ ) | join("") -}}
*) echo "[INFO] rabbitmqadmin is not available on $arch (yet?)"; exit 0 ;; \
esac; \
\
wget -O /usr/local/bin/rabbitmqadmin "$url"; \
echo "$digest */usr/local/bin/rabbitmqadmin" | sha256sum -c -; \
\
chmod +x /usr/local/bin/rabbitmqadmin; \
rabbitmqadmin --help
{{ ) else ( -}}
RUN set -eux; \
arch="$(dpkg --print-architecture)"; \
case "$arch" in \
{{ .rabbitmqadmin.arches | to_entries | map( -}}
{{ def deb_arches: {
# conversion mapping of bashbrew architectures to Debian architectures
# (most of these aren't supported/needed, but cargo-culting them makes sure nobody has to look these up in the future if the list grows)
# https://salsa.debian.org/dpkg-team/dpkg/-/blob/main/data/cputable
# https://wiki.debian.org/ArchitectureSpecificsMemo#Architecture_baselines
# https://deb.debian.org/debian/dists/unstable/Release ("Architectures:")
# http://deb.debian.org/debian/dists/unstable/main/
# http://deb.debian.org/debian/dists/stable/main/
# https://deb.debian.org/debian-ports/dists/unstable/main/
amd64: "amd64",
arm32v5: "armel",
arm32v7: "armhf",
arm64v8: "arm64",
i386: "i386",
mips64le: "mips64el",
ppc64le: "ppc64el",
riscv64: "riscv64",
s390x: "s390x",
} -}}
{{ deb_arches[.key] // empty | @sh }}) url={{ .value.url | @sh }}; digest={{ .value.digest | @sh }} ;; \
{{ ) | join("") -}}
*) echo "[INFO] rabbitmqadmin is not available on $arch (yet?)"; exit 0 ;; \
esac; \
\
savedAptMark="$(apt-mark showmanual)"; \
apt-get update; \
apt-get install -y --no-install-recommends ca-certificates wget; \
\
wget -O /usr/local/bin/rabbitmqadmin "$url"; \
echo "$digest */usr/local/bin/rabbitmqadmin" | sha256sum --strict --check -; \
\
apt-mark auto '.*' > /dev/null; \
apt-mark manual $savedAptMark > /dev/null; \
apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \
apt-get dist-clean; \
\
chmod +x /usr/local/bin/rabbitmqadmin; \
rabbitmqadmin --help
{{ ) end -}}
EXPOSE 15671 15672