From 19b6e0f6dd09afe19af337d3e3ae36bcb718bbf1 Mon Sep 17 00:00:00 2001 From: Nick Santamaria Date: Mon, 15 Jul 2024 12:26:23 +1000 Subject: [PATCH] Switch from mailhog to mailpit. (#268) --- gh-actions-bake.hcl | 9 ++++++- images/mailhog/Dockerfile | 34 --------------------------- images/mailpit/Dockerfile | 33 ++++++++++++++++++++++++++ images/{mailhog => mailpit}/README.md | 8 +++---- 4 files changed, 45 insertions(+), 39 deletions(-) delete mode 100644 images/mailhog/Dockerfile create mode 100644 images/mailpit/Dockerfile rename images/{mailhog => mailpit}/README.md (65%) diff --git a/gh-actions-bake.hcl b/gh-actions-bake.hcl index 5046fe38..9e080ff6 100755 --- a/gh-actions-bake.hcl +++ b/gh-actions-bake.hcl @@ -20,7 +20,14 @@ target "elasticsearch" { } target "mailhog" { inherits = ["docker-metadata-action"] - context = "${CONTEXT}/mailhog" + context = "${CONTEXT}/mailpit" + dockerfile = "Dockerfile" + + platforms = ["linux/amd64", "linux/arm64"] +} +target "mailpit" { + inherits = ["docker-metadata-action"] + context = "${CONTEXT}/mailpit" dockerfile = "Dockerfile" platforms = ["linux/amd64", "linux/arm64"] diff --git a/images/mailhog/Dockerfile b/images/mailhog/Dockerfile deleted file mode 100644 index 1bc18ca0..00000000 --- a/images/mailhog/Dockerfile +++ /dev/null @@ -1,34 +0,0 @@ -# -# MailHog Dockerfile -# - -FROM alpine:3 - -# Install ca-certificates, required for the "release message" feature: -RUN apk --no-cache add \ - ca-certificates - -# Install MailHog: -RUN apk --no-cache add --virtual build-dependencies \ - go \ - git \ - && mkdir -p /root/gocode \ - && export GOPATH=/root/gocode \ - && go install github.com/mailhog/MailHog@latest \ - && mv /root/gocode/bin/MailHog /usr/local/bin \ - && rm -rf /root/gocode \ - && apk del --purge build-dependencies - -# Add mailhog user/group with uid/gid 1000. -# This is a workaround for boot2docker issue #581, see -# https://github.com/boot2docker/boot2docker/issues/581 -RUN adduser -D -u 1000 mailhog - -USER mailhog - -WORKDIR /home/mailhog - -ENTRYPOINT ["MailHog"] - -# Expose the SMTP and HTTP ports: -EXPOSE 1025 8025 diff --git a/images/mailpit/Dockerfile b/images/mailpit/Dockerfile new file mode 100644 index 00000000..f6181be5 --- /dev/null +++ b/images/mailpit/Dockerfile @@ -0,0 +1,33 @@ +# +# mailpit Dockerfile +# + +FROM alpine:latest +ARG MAILPIT_VERSION=1.19.0 + +# Install ca-certificates, required for the "release message" feature: +RUN apk --no-cache add \ + ca-certificates \ + curl + +# Install mailpit. +VOLUME /tmp +WORKDIR /tmp +RUN curl -L "https://github.com/axllent/mailpit/releases/download/v${MAILPIT_VERSION}/mailpit-$(echo ${TARGETPLATFORM:-linux-amd64} | tr '/' '-').tar.gz" --output mailpit.tar.gz && \ + tar -vxxzf mailpit.tar.gz && \ + mv mailpit /bin/mailpit && \ + chmod +x /bin/mailpit + +# Add mailpit user/group with uid/gid 1000. +# This is a workaround for boot2docker issue #581, see +# https://github.com/boot2docker/boot2docker/issues/581 +RUN adduser -D -u 1000 mailpit + +USER mailpit + +WORKDIR /home/mailpit + +ENTRYPOINT ["mailpit"] + +# Expose the SMTP and HTTP ports: +EXPOSE 1025 8025 diff --git a/images/mailhog/README.md b/images/mailpit/README.md similarity index 65% rename from images/mailhog/README.md rename to images/mailpit/README.md index 7e4aa681..28fe94da 100644 --- a/images/mailhog/README.md +++ b/images/mailpit/README.md @@ -1,6 +1,6 @@ -# Container Image - bay-mailhog +# Container Image - bay-mailpit -Provides a mailhog image for local development. +Provides a [mailpit](https://github.com/axllent/mailpit) image for local development. ## Usage @@ -12,8 +12,8 @@ You can also use it in your Docker Compose stack with the following snippet: ``` services: - mailhog: - image: ghcr.io/dpc-sdp/bay/mailhog:6.x + mailpit: + image: ghcr.io/dpc-sdp/bay/mailpit:6.x ports: - 1025 - 8025