docker icon indicating copy to clipboard operation
docker copied to clipboard

Support arm64 architecture

Open EdieLemoine opened this issue 3 years ago • 3 comments

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.

EdieLemoine avatar Feb 16 '22 15:02 EdieLemoine

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

SimonasB88 avatar Mar 08 '22 16:03 SimonasB88

@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
    

EdieLemoine avatar May 20 '22 12:05 EdieLemoine