Search code examples
laravelmacosdockerapple-m1laravel-sail

No Matching Manifest Error when using Sail on Laravel


I am attempting to setup a basic project in Laravel using Laravel Sail. According to the official Laravel documentation the following commands will create a new Laravel application called "example-app" and start Laravel Sail.

curl -s "https://laravel.build/example-app" | bash
cd example-app
./vendor/bin/sail up

However, after running these commands I see the following error message:

ERROR: no matching manifest for linux/arm64/v8 in the manifest list entries

Solution

  • This error occurs when using Laravel Sail on Macs with the Apple M1 chip. The docker-compose file provided by Laravel Sail uses MySQL by default. As configured, the docker-compose file is attempting to use an unknown version of MySQL (linux/arm64/v8). This fails with the error message above.

    This can be solved by opening the docker-compose.yml file in the Laravel project root folder, searching the section named mysql and adding the following below the image: line

    platform: 'linux/amd64'
    

    Adding this line will run an Intel image under emulation on the Mac M1. You can read some background information about this in the official Docker document about Apple Silicon and here.

    If possible for your use case this can also be resolved by switching the image to MariaDB instead of MySQL. MariaDB is basically binary compatible with MySQL. Using MariaDB may be a better option if possible because, as mentioned in the Docker document

    Attempts to run Intel-based containers on Apple Silicon machines under emulation can crash as qemu sometimes fails to run the container.

    Using the MySQL container in emulation on an M1 Mac could cause issues such as a segmentation fault when starting Sail - in fact I saw this issue in one case. Switching to MariaDB resolved this. You can switch Laravel Sail to MariaDB instead of MySQL by changing the image: line for the mysql service in the docker-compose.yml file to:

    image: 'mariadb'