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

Make Images support arm64 natively for development on M1 Macs #855

Closed
aliz7 opened this issue Dec 31, 2021 · 10 comments
Closed

Make Images support arm64 natively for development on M1 Macs #855

aliz7 opened this issue Dec 31, 2021 · 10 comments

Comments

@aliz7
Copy link

aliz7 commented Dec 31, 2021

ISSUE TYPE

  • Feature request

SUMMARY

Hi,

I'm using a MacBook Pro 2021 with M1 Pro ARM CPU. Unfortunately, the custom devilbox docker images do not support arm64 natively whereas all the official httpd, php, mariadb etc. images already support arm64 natively.

Goal

Make Images support arm64 natively for development on M1 Macs

@cytopia
Copy link
Owner

cytopia commented Feb 6, 2022

Make amd64 images work on arm64

You can use an override file to explicitly emulate based on amd64: #878 (comment)

Current research

I was looking into building ARM images. This however seems to be rather problematic. I have currently tested it with a base image (PHP 8.2) in this PR: devilbox/docker-php-fpm-8.2#2

  • AMD64 image builds in about 9 minutes (as it did in single run before)
  • ARM64 image builds in about 105 minutes (more than factor 11 longer)

Timewise it would all be do-able for the used Docker images for Devilbox, however, when looking at the actual PHP images, the fastest pipeline is 1 hour. When doing ARM64 images the pipeline will most likely also be (more than) 11 times slower, which would result into something like at least 11 hours per build.

As far as I've read, GitHub actions allows a maximum of 6 hours per job, so that would be currently impossible.

Additionally, as this is only a non-commercial project I'm doing in my spare-time and migrating, testing and fixing tens of docker images would take months and lots of energey, it is something which I'm unable take. I will leave this to the community.

If somebody wants to step in and take action and is also able to solve the long-running pipelines, then let me know and we can work something out.

TL;DR

  • technical complications
  • time/resource constraints

I will pin this issue for better visibility

CC: @frumbert @Lenitr @mhodge13 @boumanb

@cytopia cytopia pinned this issue Feb 6, 2022
@cytopia
Copy link
Owner

cytopia commented Mar 22, 2022

Update

I have added two more required base images to support arm64 on Debian Jessie:

@joeke
Copy link

joeke commented Mar 24, 2022

@cytopia Not sure if I understand correctly, but to be able to use this on an M1 Mac I can only use one of the PHP base images? So in my docker-compose I cannot use for example devilbox/php-fpm:${PHP_SERVER}-work-0.136 but can only use the base PHP image (i.e. devilbox/php-fpm-8.0) but then I'd have to load php modules etc. manually?

@cytopia
Copy link
Owner

cytopia commented Mar 25, 2022

@cytopia Not sure if I understand correctly, but to be able to use this on an M1 Mac I can only use one of the PHP base images?

@joeke no, the base images cannot be used for the Devilbox. They are however a requirement to eventually build the Devilbox images.

@cytopia
Copy link
Owner

cytopia commented Mar 30, 2022

Update

There is currently a WIP PR to add arm64 images for all PHP versions (except for PHP-5.2): devilbox/docker-php-fpm#237

Pipelines to build, test and deploy takes ages, which makes debugging very time-costy. Might take hours, days or weeks, depending on how smooth everything works and how many errors will be encountered.

Screenshot 2022-03-31 03-44-04  selection

@cytopia cytopia mentioned this issue Apr 3, 2022
@cytopia
Copy link
Owner

cytopia commented Apr 6, 2022

Update

Finally full arm64 support has been released: https://github.com/cytopia/devilbox/releases/tag/v2.1.0

@frumbert @Lenitr @mhodge13 @boumanb @joeke @aliz7 could you guys give some updates on how this is working, as I don't have an arm64 machine myself

Note: You might need to delete any Devilbox amd64 docker images images locally beforehand

@joeke
Copy link

joeke commented Apr 6, 2022

@cytopia Awesome, thank you! I'll give it a test on my Macbook and let you know how it goes.

@joeke
Copy link

joeke commented Apr 6, 2022

@cytopia Looks to be working as expected from my end. I've used the bind, httpd (nginx), mysql and php (8.1 and 7.4) containers and they all work fine. Also working in the shell of the PHP containers looks good; I've used the node, npm, nvm and composer scripts inside the containers and those seem to be working fine as well.
So in short; looks to be working on M1 Mac!

@cytopia cytopia closed this as completed Apr 7, 2022
@cytopia cytopia unpinned this issue Apr 8, 2022
@howdu
Copy link

howdu commented Jul 2, 2023

Still no official support from Mailhog but there's a brilliant fork from jcalonso/MailHog which does.

mailhog/MailHog#359 (comment)

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

No branches or pull requests

4 participants