frappe / frappe_docker

Docker images for production and development setups of the Frappe framework and ERPNext
MIT License
1.51k stars 1.4k forks source link

Unable to spin up Docker containers on Apple Silicon: No matching manifest for ARM in the manifest #1458

Closed basperheim closed 2 months ago

basperheim commented 2 months ago

1. Is your issue relevant to the frappe_docker or the main Frappe framework? https://github.com/frappe/frappe . if It's the latter, publish the issue there.

The issue is with frappe_docker.

3. Use the search function before creating a new issue. Duplicates will be closed and directed to the original discussion.

I tried looking for an open ARM issue already.

5. When making a bug report, make sure you provide all the required information. The easier it is for maintainers to reproduce, the faster it'll be fixed.

Simply fails when I do docker compose -f pwd.yml up -d as instructed.

7. If you think you know what the reason for the bug is, share it with us. Maybe put in a PR 😉

Not sure exactly.

Description of the issue

~/Downloads/frappe_docker $ docker compose -f pwd.yml up -d
WARN[0000] /Users/benji/Downloads/frappe_docker/pwd.yml: `version` is obsolete 
[+] Running 4/11
 â ‹ create-site Pulling                                                                                                                                                                                         7.0s 
 â ‹ scheduler Pulling                                                                                                                                                                                           7.0s 
 ✘ frontend Error       context canceled                                                                                                                                                                       7.0s 
 â ‹ configurator Pulling                                                                                                                                                                                        7.0s 
 ✘ queue-long Error     context canceled                                                                                                                                                                       7.0s 
 â ‹ websocket Pulling                                                                                                                                                                                           7.0s 
 â ‹ backend Pulling                                                                                                                                                                                             7.0s 
 ✘ redis-cache Error    context canceled                                                                                                                                                                       7.0s 
 â ‹ redis-queue Pulling                                                                                                                                                                                         7.0s 
 ✘ db Error             context canceled                                                                                                                                                                       7.0s 
 â ‹ queue-short Pulling                                                                                                                                                                                         7.0s 
no matching manifest for linux/arm64/v8 in the manifest list entries

Context information (for bug reports)

Running arm64 macOS Sonoma with Docker Desktop (v4.32.0) and Docker Engine v27.0.3:

$ fastfetch
'                     ..'         benji@MacBook-Pro
                 ,xNMM.           -----------------
               .OMMMMo            OS: macOS Sonoma 14.6.1 arm64
               lMM"               Host: MacBook Pro (14-inch, 2021)
     .;loddo:.  .olloddol;.       Kernel: Darwin 23.6.0
...
                                  CPU: Apple M1 Pro (8) @ 3.23 GHz
                                  GPU: Apple M1 Pro (14) @ 1.30 GHz [Integrated]
                                  Memory: 13.06 GiB / 16.00 GiB (82%)
                                  Swap: 1.75 GiB / 3.00 GiB (58%)
                                  Disk (/): 411.35 GiB / 460.43 GiB (89%) - apfs [Read-only]
                                  Local IP (en4): 192.168.18.143/24
                                  Battery: 96% [AC connected]
                                  Power Adapter: 67W USB-C Power Adapter
                                  Locale: en_US.UTF-8

Steps to reproduce the issue

  1. Just run docker compose -f pwd.yml up -d on an ARM64 version of macOS

Observed result

Fails to build because of "no matching manifest for linux/arm64/v8 in the manifest list entries".

Expected result

Should be able to make a Docker setup work on ARM machines as well.

Stacktrace / full error message if available

(paste here)
revant commented 2 months ago

Check if this works

https://github.com/frappe/frappe_docker/blob/main/docs/setup_for_linux_mac.md

basperheim commented 2 months ago

Yep! That fixed it. I just made a copy of pwd.yml (cp pwd.yml pwd-arm64.yml), and I appended platform: linux/amd64 to each service in the Compose YAML file:

docker-compose -f pwd-arm64.yml up -d
WARN[0000] /Users/benji/Downloads/frappe_docker/pwd-arm64.yml: `version` is obsolete 
[+] Running 12/12
 ✔ Network frappe_docker_default           Created                                                                                                                                                                0.3s 
 ✔ Container frappe_docker-db-1            Started                                                                                                                                                                0.8s 
 ✔ Container frappe_docker-scheduler-1     Started                                                                                                                                                                0.8s 
 ✔ Container frappe_docker-redis-cache-1   Started                                                                                                                                                                0.8s 
 ✔ Container frappe_docker-create-site-1   Started                                                                                                                                                                0.7s 
 ✔ Container frappe_docker-backend-1       Started                                                                                                                                                                0.8s 
 ✔ Container frappe_docker-redis-queue-1   Started                                                                                                                                                                0.8s 
 ✔ Container frappe_docker-queue-short-1   Started                                                                                                                                                                0.8s 
 ✔ Container frappe_docker-websocket-1     Started                                                                                                                                                                0.7s 
 ✔ Container frappe_docker-queue-long-1    Started                                                                                                                                                                0.7s 
 ✔ Container frappe_docker-configurator-1  Started                                                                                                                                                                0.7s 
 ✔ Container frappe_docker-frontend-1      Started        
docker ps -a
CONTAINER ID   IMAGE                     COMMAND                  CREATED         STATUS                            PORTS                    NAMES
4c572845c6c3   frappe/erpnext:v15.35.1   "nginx-entrypoint.sh"    3 seconds ago   Up 2 seconds                      0.0.0.0:8080->8080/tcp   frappe_docker-frontend-1
e50156149e73   frappe/erpnext:v15.35.1   "node /home/frappe/f…"   4 seconds ago   Up 2 seconds                                               frappe_docker-websocket-1
1129a22f810f   frappe/erpnext:v15.35.1   "bench schedule"         4 seconds ago   Up 2 seconds                                               frappe_docker-scheduler-1
26921345ee40   frappe/erpnext:v15.35.1   "bash -c 'ls -1 apps…"   4 seconds ago   Up 2 seconds                                               frappe_docker-configurator-1
8399ae3224be   redis:6.2-alpine          "docker-entrypoint.s…"   4 seconds ago   Up 2 seconds                      6379/tcp                 frappe_docker-redis-queue-1
7db7538fca87   mariadb:10.6              "docker-entrypoint.s…"   4 seconds ago   Up 2 seconds (health: starting)   3306/tcp                 frappe_docker-db-1
c91da4c93ff2   frappe/erpnext:v15.35.1   "/home/frappe/frappe…"   4 seconds ago   Up 2 seconds                                               frappe_docker-backend-1
05ac17c4c0bb   frappe/erpnext:v15.35.1   "bash -c 'wait-for-i…"   4 seconds ago   Up 2 seconds                                               frappe_docker-create-site-1
1fd2087a99a0   frappe/erpnext:v15.35.1   "bench worker --queu…"   4 seconds ago   Up 2 seconds                                               frappe_docker-queue-long-1
c72caae224b9   redis:6.2-alpine          "docker-entrypoint.s…"   4 seconds ago   Up 2 seconds                      6379/tcp                 frappe_docker-redis-cache-1
09fa794064e1   frappe/erpnext:v15.35.1   "bench worker --queu…"   4 seconds ago   Up 2 seconds                                               frappe_docker-queue-short-1

Thank you for the help. We can close this issue now.

corv89 commented 2 months ago

I've also run into this issue.

Why isn't this the default if the images are platform dependent?

At the very least a separate compose file could be provided to avoid having to fork the repo to make trivial changes.

I think the issue should be reopened to consider a better solution

revant commented 1 month ago

I think the issue should be reopened to consider a better solution

If you have better solution you can send PR. I don't have any solution. https://github.com/frappe/frappe_docker/wiki/Frequently-Asked-Questions#how-to-build-arm64-images

We're not building arm64 images as part of ci because ERPNext is complex, it needs dependency versions pinned and most times pip install starts compiling for arm64 dependencies for 2+ hours on non-arm64 VM runners.

I build and use custom image anyway. I need more apps added with ERPNext. There I control arch and then deploy on amd64 VMs.