magento-cloud-docker
magento-cloud-docker copied to clipboard
No ARM images available for development on Macbook Pro M1 CPU
Preconditions
- Macbook Pro M1 cpu
- php 7.3
- redis 5
- elasticsearch 7.5 (attempted)
- varnish (attempted)
Steps to reproduce
- ./vendor/bin/ece-docker build:compose
- docker-compose up -d
- multiple issues arise
Expected result
- docker containers should be created, and all start with no errors
Actual result
- elasticsearch issue
-
Error: could not find libjava.so Error: Could not find Java SE Runtime Environment
- No ARM elasticsearch image provided by magento here: https://registry.hub.docker.com/r/magento/magento-cloud-docker-elasticsearch
- workaround, to use elasticsearch own here, https://registry.hub.docker.com/_/elasticsearch?tab=tags&page=1&ordering=last_updated
- e.g
image: 'elasticsearch:7.8.1'
- e.g
-
- varnish issue
-
varnish_1 | Error: varnish_1 | Running VCC-compiler failed, signal 5 varnish_1 | VCL compilation failed
- 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 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 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
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.
@asim-blueprintprep please use --no-varnish
option
@drpayyne I'm aware only about this one. Is there anything else we missing?
Not that I know of, @shiftedreality. Thanks for the update. Let me ask the community to see if anyone caught anything else.
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?
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:
- varnish & elastic are the 2 containers that don't compile properly, even under emulation of amd64
- 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,
Hi @shiftedreality! Is there any update available for public view on this? :)
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
Awesome @WingmanImd! Do you have this in your fork?
@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 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?
Hi! We're going to continue work on this issue soon.
Is there any news on this topic?
@shiftedreality any progress here?
@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.
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.
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
Hi @ferroapp Now we have prepared Dockerfiles to build images for arm64/M1, but we do not have images on docker hub.
@BaDos that's nice, what version should we try?? 1.3.3?? thank you
@ferroapp yes. you can use 1.3.3
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 docker hub contains only amd64 images, you need to build you own arm64 images using M1 machine or any arm64
@BaDos thank you!
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.
Hi @ga3003 Please, see comments above. Now you need to build arm64 images yourself.
Thanks, @BaDos.
Here is an example of how you can build arm64 images for Magento Cloud Docker 1.3.4 and Magento 2.4.5-p1:
- Clone magento cloud docker repository.
git clone https://github.com/magento/magento-cloud-docker.git
- Change current working directory to magento cloud docker.
cd magento-cloud-docker
- 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