dirtsimple / poste.io

poste.io mail server, but with IP management and custom webmail plugins
153 stars 28 forks source link

Build multi platform dokcer images #22

Closed smitev closed 2 years ago

smitev commented 2 years ago

Guidelines: https://github.com/docker/build-push-action/blob/master/docs/advanced/multi-platform.md

pjeby commented 2 years ago

Have you tested these changes?

smitev commented 2 years ago

Not really, I just followed the example here: https://github.com/docker/build-push-action/blob/master/docs/advanced/multi-platform.md

Also I updated the other actions accordingly, because I see that there are new versions for them.

smitev commented 2 years ago

After going thru the documentation, I think we need also "Set up QEMU" step. Just add it.

@pjeby what will be the best way to test the build?

pjeby commented 2 years ago

By setting it up to build on your docker hub account, then see if the builds work. You'll need to change the ${{ github.repository }} on line 13 of docker-hub.yml if your docker username or org is different than that of your fork. Tag something and build it.

When you have an image that works, you can update this PR with the necessary bits, or send me a link to your working version.

smitev commented 2 years ago

After some struggling around with the Github secrets for my repository I was able to run the workflow.

It successfully created docker image for the 2 OS/ARCH: linux/amd64 and linux/arm64 https://hub.docker.com/r/smitev/poste.io/tags

pjeby commented 2 years ago

So have you actually used the arm image and made sure it works?

smitev commented 2 years ago

I was able to pull the arm image, so the build is OK. But it didn't solve the issue I have when I deploy it to my VPS: Ubuntu 22.04.1 LTS (GNU/Linux 5.15.0-1021-oracle aarch64).

I am getting this error: "exec /init: exec format error is:closed" I found this: https://stackoverflow.com/questions/42494853/standard-init-linux-go178-exec-user-process-caused-exec-format-error

Could it be the case if some of your scripts are missing "#!/bin/bash"

pjeby commented 2 years ago

Have you tried the upstream arm builds? Does poste.io even have arm builds to begin with? Looking at https://hub.docker.com/r/analogic/poste.io/tags it doesn't look like arm is supported, which means this entire PR is moot -- this project is built as additions to that docker image, so if it doesn't do arm, then it's simply not possible for this image to.

smitev commented 2 years ago

I think you are right. Poste.io does not have ARM build. So this PR doesn't make sense at the moment. I will close it.