Skip to content

Commit 28b7aad

Browse files
committed
Ensure mhsendmail is available on arm64
1 parent 3db1b56 commit 28b7aad

14 files changed

Lines changed: 111 additions & 70 deletions

.ansible/group_vars/all/slim.yml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -273,15 +273,17 @@ base_software_available:
273273
### mhsendmail
274274
###
275275
mhsendmail:
276+
check: mhsendmail -h 2>&1 | grep 'Usage'
276277
all:
277278
type: custom
278279
command: |
279-
if [ "$(dpkg-architecture --query DEB_HOST_ARCH)" = "amd64" ]; then \
280-
curl -sS -L --fail https://github.com/devilbox/mhsendmail/releases/download/v0.3.0/mhsendmail_linux_amd64 > mhsendmail_linux_amd64 \
281-
&& chmod +x mhsendmail_linux_amd64 \
282-
&& mv mhsendmail_linux_amd64 /usr/local/bin/mhsendmail; \
280+
DEB_HOST_ARCH="$( dpkg-architecture --query DEB_HOST_ARCH )" \
281+
&& if [ "${DEB_HOST_ARCH}" = "amd64" ] || [ "${DEB_HOST_ARCH}" = "arm64" ]; then \
282+
MHSENDMAIL_URL="https://github.com/devilbox/mhsendmail/releases/download/v0.3.0/mhsendmail_linux_${DEB_HOST_ARCH}" \
283+
&& curl -sS -L --fail "${MHSENDMAIL_URL}" > /usr/local/bin/mhsendmail \
284+
&& chmod +x /usr/local/bin/mhsendmail; \
283285
else \
284-
printf '%s\n%s\n%s\n' '#!/bin/sh' 'echo "Not available for arm64."' 'exit 1' > /usr/local/bin/mhsendmail \
286+
printf '%s\n%s\n%s\n' '#!/bin/sh' 'echo "Not available for this platform."' 'exit 1' > /usr/local/bin/mhsendmail \
285287
&& chmod +x /usr/local/bin/mhsendmail; \
286288
fi \
287289

Dockerfiles/slim/Dockerfile-5.2

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,15 +67,17 @@ RUN set -eux \
6767

6868
# -------------------- mhsendmail --------------------
6969
RUN set -eux \
70-
&& if [ "$(dpkg-architecture --query DEB_HOST_ARCH)" = "amd64" ]; then \
71-
curl -sS -L --fail https://github.com/devilbox/mhsendmail/releases/download/v0.3.0/mhsendmail_linux_amd64 > mhsendmail_linux_amd64 \
72-
&& chmod +x mhsendmail_linux_amd64 \
73-
&& mv mhsendmail_linux_amd64 /usr/local/bin/mhsendmail; \
70+
&& DEB_HOST_ARCH="$( dpkg-architecture --query DEB_HOST_ARCH )" \
71+
&& if [ "${DEB_HOST_ARCH}" = "amd64" ] || [ "${DEB_HOST_ARCH}" = "arm64" ]; then \
72+
MHSENDMAIL_URL="https://github.com/devilbox/mhsendmail/releases/download/v0.3.0/mhsendmail_linux_${DEB_HOST_ARCH}" \
73+
&& curl -sS -L --fail "${MHSENDMAIL_URL}" > /usr/local/bin/mhsendmail \
74+
&& chmod +x /usr/local/bin/mhsendmail; \
7475
else \
75-
printf '%s\n%s\n%s\n' '#!/bin/sh' 'echo "Not available for arm64."' 'exit 1' > /usr/local/bin/mhsendmail \
76+
printf '%s\n%s\n%s\n' '#!/bin/sh' 'echo "Not available for this platform."' 'exit 1' > /usr/local/bin/mhsendmail \
7677
&& chmod +x /usr/local/bin/mhsendmail; \
7778
fi \
7879
\
80+
&& mhsendmail -h 2>&1 | grep 'Usage' \
7981
&& true
8082

8183
# -------------------- mongo_client --------------------
@@ -378,6 +380,7 @@ RUN set -eux \
378380

379381
# -------------------- mhsendmail --------------------
380382
RUN set -eux \
383+
&& mhsendmail -h 2>&1 | grep 'Usage' \
381384
&& true
382385

383386
# -------------------- mongo_client --------------------

Dockerfiles/slim/Dockerfile-5.3

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,15 +67,17 @@ RUN set -eux \
6767

6868
# -------------------- mhsendmail --------------------
6969
RUN set -eux \
70-
&& if [ "$(dpkg-architecture --query DEB_HOST_ARCH)" = "amd64" ]; then \
71-
curl -sS -L --fail https://github.com/devilbox/mhsendmail/releases/download/v0.3.0/mhsendmail_linux_amd64 > mhsendmail_linux_amd64 \
72-
&& chmod +x mhsendmail_linux_amd64 \
73-
&& mv mhsendmail_linux_amd64 /usr/local/bin/mhsendmail; \
70+
&& DEB_HOST_ARCH="$( dpkg-architecture --query DEB_HOST_ARCH )" \
71+
&& if [ "${DEB_HOST_ARCH}" = "amd64" ] || [ "${DEB_HOST_ARCH}" = "arm64" ]; then \
72+
MHSENDMAIL_URL="https://github.com/devilbox/mhsendmail/releases/download/v0.3.0/mhsendmail_linux_${DEB_HOST_ARCH}" \
73+
&& curl -sS -L --fail "${MHSENDMAIL_URL}" > /usr/local/bin/mhsendmail \
74+
&& chmod +x /usr/local/bin/mhsendmail; \
7475
else \
75-
printf '%s\n%s\n%s\n' '#!/bin/sh' 'echo "Not available for arm64."' 'exit 1' > /usr/local/bin/mhsendmail \
76+
printf '%s\n%s\n%s\n' '#!/bin/sh' 'echo "Not available for this platform."' 'exit 1' > /usr/local/bin/mhsendmail \
7677
&& chmod +x /usr/local/bin/mhsendmail; \
7778
fi \
7879
\
80+
&& mhsendmail -h 2>&1 | grep 'Usage' \
7981
&& true
8082

8183
# -------------------- mongo_client --------------------
@@ -378,6 +380,7 @@ RUN set -eux \
378380

379381
# -------------------- mhsendmail --------------------
380382
RUN set -eux \
383+
&& mhsendmail -h 2>&1 | grep 'Usage' \
381384
&& true
382385

383386
# -------------------- mongo_client --------------------

Dockerfiles/slim/Dockerfile-5.4

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,15 +67,17 @@ RUN set -eux \
6767

6868
# -------------------- mhsendmail --------------------
6969
RUN set -eux \
70-
&& if [ "$(dpkg-architecture --query DEB_HOST_ARCH)" = "amd64" ]; then \
71-
curl -sS -L --fail https://github.com/devilbox/mhsendmail/releases/download/v0.3.0/mhsendmail_linux_amd64 > mhsendmail_linux_amd64 \
72-
&& chmod +x mhsendmail_linux_amd64 \
73-
&& mv mhsendmail_linux_amd64 /usr/local/bin/mhsendmail; \
70+
&& DEB_HOST_ARCH="$( dpkg-architecture --query DEB_HOST_ARCH )" \
71+
&& if [ "${DEB_HOST_ARCH}" = "amd64" ] || [ "${DEB_HOST_ARCH}" = "arm64" ]; then \
72+
MHSENDMAIL_URL="https://github.com/devilbox/mhsendmail/releases/download/v0.3.0/mhsendmail_linux_${DEB_HOST_ARCH}" \
73+
&& curl -sS -L --fail "${MHSENDMAIL_URL}" > /usr/local/bin/mhsendmail \
74+
&& chmod +x /usr/local/bin/mhsendmail; \
7475
else \
75-
printf '%s\n%s\n%s\n' '#!/bin/sh' 'echo "Not available for arm64."' 'exit 1' > /usr/local/bin/mhsendmail \
76+
printf '%s\n%s\n%s\n' '#!/bin/sh' 'echo "Not available for this platform."' 'exit 1' > /usr/local/bin/mhsendmail \
7677
&& chmod +x /usr/local/bin/mhsendmail; \
7778
fi \
7879
\
80+
&& mhsendmail -h 2>&1 | grep 'Usage' \
7981
&& true
8082

8183
# -------------------- mongo_client --------------------
@@ -378,6 +380,7 @@ RUN set -eux \
378380

379381
# -------------------- mhsendmail --------------------
380382
RUN set -eux \
383+
&& mhsendmail -h 2>&1 | grep 'Usage' \
381384
&& true
382385

383386
# -------------------- mongo_client --------------------

Dockerfiles/slim/Dockerfile-5.5

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,15 +67,17 @@ RUN set -eux \
6767

6868
# -------------------- mhsendmail --------------------
6969
RUN set -eux \
70-
&& if [ "$(dpkg-architecture --query DEB_HOST_ARCH)" = "amd64" ]; then \
71-
curl -sS -L --fail https://github.com/devilbox/mhsendmail/releases/download/v0.3.0/mhsendmail_linux_amd64 > mhsendmail_linux_amd64 \
72-
&& chmod +x mhsendmail_linux_amd64 \
73-
&& mv mhsendmail_linux_amd64 /usr/local/bin/mhsendmail; \
70+
&& DEB_HOST_ARCH="$( dpkg-architecture --query DEB_HOST_ARCH )" \
71+
&& if [ "${DEB_HOST_ARCH}" = "amd64" ] || [ "${DEB_HOST_ARCH}" = "arm64" ]; then \
72+
MHSENDMAIL_URL="https://github.com/devilbox/mhsendmail/releases/download/v0.3.0/mhsendmail_linux_${DEB_HOST_ARCH}" \
73+
&& curl -sS -L --fail "${MHSENDMAIL_URL}" > /usr/local/bin/mhsendmail \
74+
&& chmod +x /usr/local/bin/mhsendmail; \
7475
else \
75-
printf '%s\n%s\n%s\n' '#!/bin/sh' 'echo "Not available for arm64."' 'exit 1' > /usr/local/bin/mhsendmail \
76+
printf '%s\n%s\n%s\n' '#!/bin/sh' 'echo "Not available for this platform."' 'exit 1' > /usr/local/bin/mhsendmail \
7677
&& chmod +x /usr/local/bin/mhsendmail; \
7778
fi \
7879
\
80+
&& mhsendmail -h 2>&1 | grep 'Usage' \
7981
&& true
8082

8183
# -------------------- mongo_client --------------------
@@ -378,6 +380,7 @@ RUN set -eux \
378380

379381
# -------------------- mhsendmail --------------------
380382
RUN set -eux \
383+
&& mhsendmail -h 2>&1 | grep 'Usage' \
381384
&& true
382385

383386
# -------------------- mongo_client --------------------

Dockerfiles/slim/Dockerfile-5.6

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,15 +67,17 @@ RUN set -eux \
6767

6868
# -------------------- mhsendmail --------------------
6969
RUN set -eux \
70-
&& if [ "$(dpkg-architecture --query DEB_HOST_ARCH)" = "amd64" ]; then \
71-
curl -sS -L --fail https://github.com/devilbox/mhsendmail/releases/download/v0.3.0/mhsendmail_linux_amd64 > mhsendmail_linux_amd64 \
72-
&& chmod +x mhsendmail_linux_amd64 \
73-
&& mv mhsendmail_linux_amd64 /usr/local/bin/mhsendmail; \
70+
&& DEB_HOST_ARCH="$( dpkg-architecture --query DEB_HOST_ARCH )" \
71+
&& if [ "${DEB_HOST_ARCH}" = "amd64" ] || [ "${DEB_HOST_ARCH}" = "arm64" ]; then \
72+
MHSENDMAIL_URL="https://github.com/devilbox/mhsendmail/releases/download/v0.3.0/mhsendmail_linux_${DEB_HOST_ARCH}" \
73+
&& curl -sS -L --fail "${MHSENDMAIL_URL}" > /usr/local/bin/mhsendmail \
74+
&& chmod +x /usr/local/bin/mhsendmail; \
7475
else \
75-
printf '%s\n%s\n%s\n' '#!/bin/sh' 'echo "Not available for arm64."' 'exit 1' > /usr/local/bin/mhsendmail \
76+
printf '%s\n%s\n%s\n' '#!/bin/sh' 'echo "Not available for this platform."' 'exit 1' > /usr/local/bin/mhsendmail \
7677
&& chmod +x /usr/local/bin/mhsendmail; \
7778
fi \
7879
\
80+
&& mhsendmail -h 2>&1 | grep 'Usage' \
7981
&& true
8082

8183
# -------------------- mongo_client --------------------
@@ -382,6 +384,7 @@ RUN set -eux \
382384

383385
# -------------------- mhsendmail --------------------
384386
RUN set -eux \
387+
&& mhsendmail -h 2>&1 | grep 'Usage' \
385388
&& true
386389

387390
# -------------------- mongo_client --------------------

Dockerfiles/slim/Dockerfile-7.0

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,15 +67,17 @@ RUN set -eux \
6767

6868
# -------------------- mhsendmail --------------------
6969
RUN set -eux \
70-
&& if [ "$(dpkg-architecture --query DEB_HOST_ARCH)" = "amd64" ]; then \
71-
curl -sS -L --fail https://github.com/devilbox/mhsendmail/releases/download/v0.3.0/mhsendmail_linux_amd64 > mhsendmail_linux_amd64 \
72-
&& chmod +x mhsendmail_linux_amd64 \
73-
&& mv mhsendmail_linux_amd64 /usr/local/bin/mhsendmail; \
70+
&& DEB_HOST_ARCH="$( dpkg-architecture --query DEB_HOST_ARCH )" \
71+
&& if [ "${DEB_HOST_ARCH}" = "amd64" ] || [ "${DEB_HOST_ARCH}" = "arm64" ]; then \
72+
MHSENDMAIL_URL="https://github.com/devilbox/mhsendmail/releases/download/v0.3.0/mhsendmail_linux_${DEB_HOST_ARCH}" \
73+
&& curl -sS -L --fail "${MHSENDMAIL_URL}" > /usr/local/bin/mhsendmail \
74+
&& chmod +x /usr/local/bin/mhsendmail; \
7475
else \
75-
printf '%s\n%s\n%s\n' '#!/bin/sh' 'echo "Not available for arm64."' 'exit 1' > /usr/local/bin/mhsendmail \
76+
printf '%s\n%s\n%s\n' '#!/bin/sh' 'echo "Not available for this platform."' 'exit 1' > /usr/local/bin/mhsendmail \
7677
&& chmod +x /usr/local/bin/mhsendmail; \
7778
fi \
7879
\
80+
&& mhsendmail -h 2>&1 | grep 'Usage' \
7981
&& true
8082

8183
# -------------------- mongo_client --------------------
@@ -382,6 +384,7 @@ RUN set -eux \
382384

383385
# -------------------- mhsendmail --------------------
384386
RUN set -eux \
387+
&& mhsendmail -h 2>&1 | grep 'Usage' \
385388
&& true
386389

387390
# -------------------- mongo_client --------------------

Dockerfiles/slim/Dockerfile-7.1

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,15 +67,17 @@ RUN set -eux \
6767

6868
# -------------------- mhsendmail --------------------
6969
RUN set -eux \
70-
&& if [ "$(dpkg-architecture --query DEB_HOST_ARCH)" = "amd64" ]; then \
71-
curl -sS -L --fail https://github.com/devilbox/mhsendmail/releases/download/v0.3.0/mhsendmail_linux_amd64 > mhsendmail_linux_amd64 \
72-
&& chmod +x mhsendmail_linux_amd64 \
73-
&& mv mhsendmail_linux_amd64 /usr/local/bin/mhsendmail; \
70+
&& DEB_HOST_ARCH="$( dpkg-architecture --query DEB_HOST_ARCH )" \
71+
&& if [ "${DEB_HOST_ARCH}" = "amd64" ] || [ "${DEB_HOST_ARCH}" = "arm64" ]; then \
72+
MHSENDMAIL_URL="https://github.com/devilbox/mhsendmail/releases/download/v0.3.0/mhsendmail_linux_${DEB_HOST_ARCH}" \
73+
&& curl -sS -L --fail "${MHSENDMAIL_URL}" > /usr/local/bin/mhsendmail \
74+
&& chmod +x /usr/local/bin/mhsendmail; \
7475
else \
75-
printf '%s\n%s\n%s\n' '#!/bin/sh' 'echo "Not available for arm64."' 'exit 1' > /usr/local/bin/mhsendmail \
76+
printf '%s\n%s\n%s\n' '#!/bin/sh' 'echo "Not available for this platform."' 'exit 1' > /usr/local/bin/mhsendmail \
7677
&& chmod +x /usr/local/bin/mhsendmail; \
7778
fi \
7879
\
80+
&& mhsendmail -h 2>&1 | grep 'Usage' \
7981
&& true
8082

8183
# -------------------- mongo_client --------------------
@@ -376,6 +378,7 @@ RUN set -eux \
376378

377379
# -------------------- mhsendmail --------------------
378380
RUN set -eux \
381+
&& mhsendmail -h 2>&1 | grep 'Usage' \
379382
&& true
380383

381384
# -------------------- mongo_client --------------------

Dockerfiles/slim/Dockerfile-7.2

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,15 +67,17 @@ RUN set -eux \
6767

6868
# -------------------- mhsendmail --------------------
6969
RUN set -eux \
70-
&& if [ "$(dpkg-architecture --query DEB_HOST_ARCH)" = "amd64" ]; then \
71-
curl -sS -L --fail https://github.com/devilbox/mhsendmail/releases/download/v0.3.0/mhsendmail_linux_amd64 > mhsendmail_linux_amd64 \
72-
&& chmod +x mhsendmail_linux_amd64 \
73-
&& mv mhsendmail_linux_amd64 /usr/local/bin/mhsendmail; \
70+
&& DEB_HOST_ARCH="$( dpkg-architecture --query DEB_HOST_ARCH )" \
71+
&& if [ "${DEB_HOST_ARCH}" = "amd64" ] || [ "${DEB_HOST_ARCH}" = "arm64" ]; then \
72+
MHSENDMAIL_URL="https://github.com/devilbox/mhsendmail/releases/download/v0.3.0/mhsendmail_linux_${DEB_HOST_ARCH}" \
73+
&& curl -sS -L --fail "${MHSENDMAIL_URL}" > /usr/local/bin/mhsendmail \
74+
&& chmod +x /usr/local/bin/mhsendmail; \
7475
else \
75-
printf '%s\n%s\n%s\n' '#!/bin/sh' 'echo "Not available for arm64."' 'exit 1' > /usr/local/bin/mhsendmail \
76+
printf '%s\n%s\n%s\n' '#!/bin/sh' 'echo "Not available for this platform."' 'exit 1' > /usr/local/bin/mhsendmail \
7677
&& chmod +x /usr/local/bin/mhsendmail; \
7778
fi \
7879
\
80+
&& mhsendmail -h 2>&1 | grep 'Usage' \
7981
&& true
8082

8183
# -------------------- mongo_client --------------------
@@ -376,6 +378,7 @@ RUN set -eux \
376378

377379
# -------------------- mhsendmail --------------------
378380
RUN set -eux \
381+
&& mhsendmail -h 2>&1 | grep 'Usage' \
379382
&& true
380383

381384
# -------------------- mongo_client --------------------

Dockerfiles/slim/Dockerfile-7.3

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,15 +67,17 @@ RUN set -eux \
6767

6868
# -------------------- mhsendmail --------------------
6969
RUN set -eux \
70-
&& if [ "$(dpkg-architecture --query DEB_HOST_ARCH)" = "amd64" ]; then \
71-
curl -sS -L --fail https://github.com/devilbox/mhsendmail/releases/download/v0.3.0/mhsendmail_linux_amd64 > mhsendmail_linux_amd64 \
72-
&& chmod +x mhsendmail_linux_amd64 \
73-
&& mv mhsendmail_linux_amd64 /usr/local/bin/mhsendmail; \
70+
&& DEB_HOST_ARCH="$( dpkg-architecture --query DEB_HOST_ARCH )" \
71+
&& if [ "${DEB_HOST_ARCH}" = "amd64" ] || [ "${DEB_HOST_ARCH}" = "arm64" ]; then \
72+
MHSENDMAIL_URL="https://github.com/devilbox/mhsendmail/releases/download/v0.3.0/mhsendmail_linux_${DEB_HOST_ARCH}" \
73+
&& curl -sS -L --fail "${MHSENDMAIL_URL}" > /usr/local/bin/mhsendmail \
74+
&& chmod +x /usr/local/bin/mhsendmail; \
7475
else \
75-
printf '%s\n%s\n%s\n' '#!/bin/sh' 'echo "Not available for arm64."' 'exit 1' > /usr/local/bin/mhsendmail \
76+
printf '%s\n%s\n%s\n' '#!/bin/sh' 'echo "Not available for this platform."' 'exit 1' > /usr/local/bin/mhsendmail \
7677
&& chmod +x /usr/local/bin/mhsendmail; \
7778
fi \
7879
\
80+
&& mhsendmail -h 2>&1 | grep 'Usage' \
7981
&& true
8082

8183
# -------------------- mongo_client --------------------
@@ -376,6 +378,7 @@ RUN set -eux \
376378

377379
# -------------------- mhsendmail --------------------
378380
RUN set -eux \
381+
&& mhsendmail -h 2>&1 | grep 'Usage' \
379382
&& true
380383

381384
# -------------------- mongo_client --------------------

0 commit comments

Comments
 (0)