PrestaShop / docker

🐳
https://hub.docker.com/r/prestashop/prestashop/
MIT License
259 stars 177 forks source link

Support arm64 architecture #294

Open EdieLemoine opened 2 years ago

EdieLemoine commented 2 years ago

I'm running Docker 4.5.0 on a 2021 MacBook Pro with an Apple M1 Pro chip and get this warning when using PrestaShop images:

WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested

I can get the linux/amd64 version to work (thanks to Rosetta), but it would be great if the images have native ARM support.

SimonasB88 commented 2 years ago

@EdieLemoine have you tried platform: linux/x86_64 in docker-compose or --platform linux/x86_64 in docker run flag?

EdieLemoine commented 2 years ago

@SimonasB88 sorry for the delayed reaction. Of course, that works, but it's extremely slow.

I've solved it myself (at least temporarily) by executing these steps I wrote to locally build ARM versions on my machine :)

First, clone this repository and follow the instructions in HOW-TO-USE.md.

⚠ Note: This example uses php 7.4-fpm and PS 1.7.8.3, but you can build any version by adjusting the build folders and tags.

  1. Build prestashop/base:
    # CWD: Prestashop/Docker repository
    docker build base/images/7.4-fpm -t prestashop/base:7.4-fpm
  2. Build prestashop/prestashop, which depends on the prestashop/base image you just built:
    # CWD: Prestashop/Docker repository
    docker build images/1.7.8.2/7.4-fpm -t prestashop/prestashop:1.7.8.2-7.4-fpm

And then the steps to apply this to our specific implementation:

  1. Build your own myparcel/prestashop image, which depends on prestashop/prestashop:

    ⚠️ Note: PS_VERSION should match the tag created in step 2

    # CWD: MyParcel docker-prestashop repository
    docker compose build web --build-arg="PS_VERSION=1.7.8.2-7.4-fpm"
  2. Start the container and verify everything went right:
    docker compose up -d web