Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

arm64 builds #28

Open
tomjn opened this issue Mar 15, 2021 · 7 comments
Open

arm64 builds #28

tomjn opened this issue Mar 15, 2021 · 7 comments

Comments

@tomjn
Copy link

tomjn commented Mar 15, 2021

The current release has a linux_arm build but this does not work on Apple Silicon Macs. An arm64 build is necessary

@evertiro
Copy link

To elaborate on the above, we use MailHog and mhsendmail in VVV. We actually don't use an arm64 build currently, but may well in the future. We currently use an aarch64 build (which is also not provided). I'm currently providing downloads for both MailHog and mhsendmail on both arm64 and aarch64 oh my forks.

https://github.com/evertiro/mhsendmail/releases/tag/v0.2.0-M1

https://github.com/evertiro/MailHog/releases/tag/v1.0.0-M1

@drpayyne
Copy link

drpayyne commented Sep 8, 2021

Hi @evertiro, could you please provide instructions on how to rebuild this repo to provide for multi-arch binaries? I'd like to test out a lot of architectures, as from what I see in your links, you have just for ARM64. Thanks in advance!

@FrancoLoyola
Copy link

FrancoLoyola commented Dec 23, 2021

These might do the trick for you:
GOOS=linux GOARCH=arm64 go build -o $some-name .
GOOS=darwin GOARCH=arm64 go build -o $some-name .

https://www.digitalocean.com/community/tutorials/how-to-build-go-executables-for-multiple-platforms-on-ubuntu-16-04

@na0x2c6
Copy link

na0x2c6 commented Dec 26, 2021

I am also using an Apple Silicon Mac, and it works by fixing my Dockerfile as follows:

+FROM golang:1.15 AS builder
+RUN go get -d -v github.com/mailhog/mhsendmail \
+  && cd /go/src/github.com/mailhog/mhsendmail/ \
+  && GOOS=linux GOARCH=arm64 go build -o mhsendmail .
+
 FROM wordpress:php7.4-apache
 # Install mhsendmail
-RUN curl -sS https://github.com/mailhog/mhsendmail/releases/download/v0.2.0/mhsendmail_linux_amd64 -L -o /usr/local/bin/mhsendmail \
-    && chmod +x /usr/local/bin/mhsendmail \
+COPY --from=builder /go/src/github.com/mailhog/mhsendmail/mhsendmail /usr/local/bin/
+RUN chmod +x /usr/local/bin/mhsendmail \
     && echo 'sendmail_path = "/usr/local/bin/mhsendmail --smtp-addr=mail:1025"' > /usr/local/etc/php/conf.d/sendmail.ini

Thanks @FrancoLoyola

@dndeus
Copy link

dndeus commented Apr 22, 2022

Is there any news regarding this?

Do you recommend any other solution?

Thanks

@FrancoLoyola
Copy link

FrancoLoyola commented May 4, 2022

Re-compile in Go takes at most a couple of seconds, it could be nice that a release is added to the repo, but the solution provided by @uedder should work, you could update the line FROM golang:1.15 to 1.18 so you get some goodies for free (check Go's release notes, tons nice of stuff).

Else try with @evertiro 's releases, I don't have a M1 based mac anymore, but they might work in your system.

EDIT: You can build it locally without docker if you have go installed in your system to. Just clone the repo and run go build -o mailhog . in the folder that has the main.go file, it will detect automatically the OS and arch, so the binary will work in your system.

ercanozkaya added a commit to joomlatools/joomlatools-server that referenced this issue May 31, 2022
We use a builder ourselves as the releases do not have an arm64 binary.
See: mailhog/mhsendmail#28 (comment)
@cytopia
Copy link

cytopia commented Dec 8, 2022

These might do the trick for you: GOOS=linux GOARCH=arm64 go build -o $some-name . GOOS=darwin GOARCH=arm64 go build -o $some-name .

https://www.digitalocean.com/community/tutorials/how-to-build-go-executables-for-multiple-platforms-on-ubuntu-16-04

Thanks @FrancoLoyola and @na0x2c6 👍

I've added binary releases (amd64 and arm64) here: https://github.com/devilbox/mhsendmail/releases/tag/v0.3.0

Note: This also includes the -o fix for sendmail compatibility from @BlueBambooStudios fork available here: https://github.com/BlueBambooStudios/mhsendmail/releases/tag/v0.3.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants