magento-cloud-docker icon indicating copy to clipboard operation
magento-cloud-docker copied to clipboard

No ARM images available for development on Macbook Pro M1 CPU

Open asim-blueprintprep opened this issue 3 years ago • 35 comments

Preconditions

  1. Macbook Pro M1 cpu
  2. php 7.3
  3. redis 5
  4. elasticsearch 7.5 (attempted)
  5. varnish (attempted)

Steps to reproduce

  1. ./vendor/bin/ece-docker build:compose
  2. docker-compose up -d
  3. multiple issues arise

Expected result

  1. docker containers should be created, and all start with no errors

Actual result

  1. elasticsearch issue
    1. Error: could not find libjava.so Error: Could not find Java SE Runtime Environment
    2. No ARM elasticsearch image provided by magento here: https://registry.hub.docker.com/r/magento/magento-cloud-docker-elasticsearch
    3. workaround, to use elasticsearch own here, https://registry.hub.docker.com/_/elasticsearch?tab=tags&page=1&ordering=last_updated
      1. e.g image: 'elasticsearch:7.8.1'
  2. varnish issue
    1. varnish_1 | Error: varnish_1 | Running VCC-compiler failed, signal 5 varnish_1 | VCL compilation failed
    2. There are no ARM varnish images available in magento or varnishes own docker repos

Is there a known way of getting cloud docker to boot on a new Macbook Pro?

Or is there a way to disable varnish, and have the docker just go straight to the frontend node to serve the site without a FPC?

asim-blueprintprep avatar Jun 10 '21 10:06 asim-blueprintprep

@asim-blueprintprep thank you for this request.

We've created an internal issue https://jira.corp.magento.com/browse/MCLOUD-7989 to get it fixed. However, any help is appreciated!

shiftedreality avatar Jun 10 '21 13:06 shiftedreality

@shiftedreality thanks for repsonding so swiftly, do you know of a way of disabling varnish through docker compose, and configuring it so the site loads without varnish? As this is currently blocking development work

asim-blueprintprep avatar Jun 11 '21 07:06 asim-blueprintprep

Hi @shiftedreality, is there any ticket to track the dependencies of cloud-docker and their compatibility with the Apple M1 chip? Just so that it's visible on what's pending for us Magento developers to start using cloud-docker on our Apple M1 computers.

drpayyne avatar Jun 15 '21 13:06 drpayyne

@asim-blueprintprep please use --no-varnish option

shiftedreality avatar Jun 15 '21 13:06 shiftedreality

@drpayyne I'm aware only about this one. Is there anything else we missing?

shiftedreality avatar Jun 15 '21 13:06 shiftedreality

Not that I know of, @shiftedreality. Thanks for the update. Let me ask the community to see if anyone caught anything else.

drpayyne avatar Jun 15 '21 13:06 drpayyne

Hi @shiftedreality That created great, and allowed me to get docker-compose up -d booting all containers, I then run bash ./mutagen.sh And then try to run docker-compose run --rm deploy cloud-deploy

However, it errors: [2021-06-16 14:48:55] ERROR: [132] Can't get version of elasticsearch: cURL error 6: Could not resolve host: elasticsearch (see https://curl.haxx.se/libcurl/c/libcurl-errors.html)

I can't help but wonder, if this is because I've changed the elasticsearch image to not be a magento-elasticsearch image?

asim-blueprintprep avatar Jun 16 '21 14:06 asim-blueprintprep

I believe the issue above is resolved by having elasticsearch in your hosts file, after adding that and rebuilding that works. However, because docker desktop is having to emulate so many amd64 packages, it runs out of memory

https://github.com/docker/for-mac/issues/5204

When running docker-compose run --rm deploy cloud-deploy

It reaches: [2021-06-17 08:49:41] INFO: Running setup upgrade. [2021-06-17 08:49:58] ERROR: [126] The command "/bin/bash -c "set -o pipefail; php ./bin/magento setup:upgrade --keep-generated --ansi --no-interaction | tee -a /app/var/log/install_upgrade.log"" failed. mmap() failed: [12] Cannot allocate memory

This is with 6GB RAM set available for docker desktop, I tried increasing it to 12GB, and the same error happened (with qemu actually using 16GB RAM - taken from top command)

So far:

  1. varnish & elastic are the 2 containers that don't compile properly, even under emulation of amd64
  2. docker runs out of memory trying to emulate all of the containers as ARM instead of amd64

I am out of ideas on how to progress this any further, without there being any ARM builds available

Thanks,

asim-blueprintprep avatar Jun 17 '21 08:06 asim-blueprintprep

Hi @shiftedreality! Is there any update available for public view on this? :)

drpayyne avatar Jul 27 '21 15:07 drpayyne

Hey @drpayyne I have a working docker-compose.yml file in case you still need it. You'll need to keep the Dockerfiles in the project(I don't plan on pushing them to docker hub) though

WingmanImd avatar Sep 17 '21 10:09 WingmanImd

Awesome @WingmanImd! Do you have this in your fork?

drpayyne avatar Sep 17 '21 10:09 drpayyne

@drpayyne no, I had to resort to manually editing the docker-compose.yml file after it's created then use modified versions of Dockerfiles for all images. Gonna fork it again and edit the Readme with the instructions later today

WingmanImd avatar Sep 17 '21 10:09 WingmanImd

@WingmanImd Can you share a little more info about your approach to getting set up with the M1 chip?

Hello guys any one resolved this issue?

AlexanderKopyl avatar Jan 21 '22 10:01 AlexanderKopyl

Hi! We're going to continue work on this issue soon.

BaDos avatar Jan 21 '22 15:01 BaDos

Is there any news on this topic?

self-diagnostics avatar Apr 28 '22 08:04 self-diagnostics

@shiftedreality any progress here?

MaximGns avatar Jun 17 '22 13:06 MaximGns

@BaDos I head up C3, an Adobe Commerce partner agency in the UK, and this is something I and my team need. I'm keen to know if I can be of help to move this forward - we have lots of Docker experience.

mustdobetter avatar Jul 05 '22 10:07 mustdobetter

I've just found a commit adding support: 50c77b0dc30ea33b86fe8d02224342d6c9484e93. Thank you @BaDos! 🙌

I've successfully built and run the PHP 7.4 FPM image on ARM (MacBook Pro Max), and all seems to be working well. I'll be building and testing some of the others shortly and will feed back on any issues etc.

mustdobetter avatar Jul 05 '22 11:07 mustdobetter

Hi, I wonder if there is any progress on this, we are stuck in the same situation, version 2.4..4, any help will be much appreciated

ferroapp avatar Sep 27 '22 02:09 ferroapp

Hi @ferroapp Now we have prepared Dockerfiles to build images for arm64/M1, but we do not have images on docker hub.

BaDos avatar Sep 27 '22 17:09 BaDos

@BaDos that's nice, what version should we try?? 1.3.3?? thank you

ferroapp avatar Sep 28 '22 16:09 ferroapp

@ferroapp yes. you can use 1.3.3

BaDos avatar Sep 28 '22 19:09 BaDos

really happy about the ARM64 support added in 1.3.3. thank you guys!

we updated to 1.3.3 and built a new docker setup but still AMD64 images. what do we have to update to use the ARM64? thanks in advance!

mamarx avatar Sep 29 '22 12:09 mamarx

@mamarx docker hub contains only amd64 images, you need to build you own arm64 images using M1 machine or any arm64

BaDos avatar Sep 29 '22 15:09 BaDos

@BaDos thank you!

mamarx avatar Sep 30 '22 12:09 mamarx

Is there any update on this issue? I am using the Mac Pro M2 and I am facing the same issue where I got a warning for ARM images and when the setup is complete, the URL is showing an error message of not reachable.

Please help, if someone has any hack to solve this.

ga3003 avatar Nov 04 '22 07:11 ga3003

Hi @ga3003 Please, see comments above. Now you need to build arm64 images yourself.

BaDos avatar Nov 04 '22 15:11 BaDos

Thanks, @BaDos.

ga3003 avatar Nov 16 '22 10:11 ga3003

Here is an example of how you can build arm64 images for Magento Cloud Docker 1.3.4 and Magento 2.4.5-p1:

  1. Clone magento cloud docker repository.
    git clone https://github.com/magento/magento-cloud-docker.git
    
  2. Change current working directory to magento cloud docker.
    cd magento-cloud-docker
    
  3. Build docker images.
    docker image build --platform=linux/arm64/v8 -t magento/magento-cloud-docker-php:8.1-cli-1.3.4 ./images/php/8.1-cli
    
    docker image build --platform=linux/arm64/v8 -t magento/magento-cloud-docker-opensearch:1.2-1.3.4 ./images/opensearch/1.2
    
    docker image build --platform=linux/arm64/v8 -t magento/magento-cloud-docker-nginx:1.19-1.3.4 ./images/nginx/1.19
    
    docker image build --platform=linux/arm64/v8 -t magento/magento-cloud-docker-varnish:6.6-1.3.4 ./images/varnish/6.6
    

pawelskowronek avatar Jan 19 '23 21:01 pawelskowronek