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

Does Devilbox work on Apple Silicon? #822

Closed
frumbert opened this issue Jul 1, 2021 · 6 comments
Closed

Does Devilbox work on Apple Silicon? #822

frumbert opened this issue Jul 1, 2021 · 6 comments

Comments

@frumbert
Copy link

frumbert commented Jul 1, 2021

there a way to install or run Devilbox on Apple M1 Macs?

Attached is a log of performing docker-compose up on a new installation. Look like dystopia/bind, devilbox/php-fpm, devilbox/apache and devilbox/mysql all use amd64 images. How does one switch to arm64 images?

docker-compose up M1.txt

@cytopia
Copy link
Owner

cytopia commented Jul 1, 2021

there a way to install or run Devilbox on Apple M1 Macs?

There are no arm64 images available at the moment.

@Lenitr
Copy link

Lenitr commented Aug 6, 2021

I'm wondering if you're thinking of supporting arm64 in the future? Or are you dependant on others to test this?

Thanks a lot for your effort and time in this project!

@mhodge13
Copy link
Contributor

mhodge13 commented Nov 9, 2021

This article may help when you are ready to create the arm64 images.

https://www.docker.com/blog/multi-arch-images/

@boumanb
Copy link

boumanb commented Dec 12, 2021

Got Devilbox to run on my MacBook Air (MBA) M1 (16GB/512GB) (which I received last week, returning it) without any modifications. Executing docker-compose up is all you need to do right now.

However; the performance is horrible. This has nothing to do with Devilbox.

It's the IO operations on mounted volumes on Mac devices. Performance was okay on my 2020 MacBook Pro, nothing compared to linux but, okay. One way to tweak performance of the mounted volumes is leveraging NFS as instructed here. It enhances performance greatly.

I'll look into writing a PR to provide documentation (steps and/ or basic files) on how to set this up.

On the MBA M1 I've received I installed docker, cloned devilbox and started testing with and without NFS mounted volumes. The results of running time composer install --no-cache inside devilbox below:

Without NFS setup real user sys
1 1m25.686s 0m42.663s 0m13.287s
2 1m19.531s 0m41.323s 0m13.141s
3 1m23.592s 0m42.235s 0m13.373s
       
With NFS setup real user sys
1 0m43.027s 0m31.816s 0m10.757s
2 0m45.518s 0m30.987s 0m10.458s
3 0m41.481s 0m30.906s 0m10.508s

With these results (using NFS setup) the performance on the MBA M1 is slightly worse compared to my "old" MacBook Pro 2020 Intel (16GB/512GB). Also, I like to make use of Remote Development - Containers in VS Code, it enables me to do everything from within my VS Code window (running commands in the integrated terminal directly in devilbox and editing source files). Also, some extensions require PHP, which I want to keep off my host system, they are able to run because they are being installed inside of the development container by VS Code. It is great. The problem however is; qemu eating my RAM on the MBA M1 (when using the integrated VS Code terminal) and causing it to crash, both docker (devilbox containers) and VS Code.

This forces me to return it, because I was looking for a upgrade in contrast to a downgrade.

I have to admit, running commands like npm install run unbelievably fast on the host, just not inside of devilbox (docker). People are able to workaround the problem by running certain commands on the host machine but that's not the preferred workflow. The M1 is great. It does not get warm, the fans won't turn on (because it doesn't have them :)) and the battery is great (docker does drain it so shut that down when not using it).

@cytopia cytopia self-assigned this Feb 6, 2022
@cytopia
Copy link
Owner

cytopia commented Feb 6, 2022

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 100 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 was 1 hours. 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.

@cytopia
Copy link
Owner

cytopia commented Feb 6, 2022

Closing in favour of this: #855

@cytopia cytopia closed this as completed Feb 6, 2022
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

5 participants