Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Building for platform: linux/x86_64 on Apple silicon fails with errors #769

Open
diractorhm opened this issue Jan 21, 2025 · 2 comments
Open

Comments

@diractorhm
Copy link

Sail Version

1.40.0

Laravel Version

11.38.2

PHP Version

8.3

Operating System

macOS

OS Version

15.2

Description

I try to build a new app like described here: https://laravel.com/docs/11.x/installation#sail-on-macos
Since I need PHP 8.3 and support for the x86_64 platform, I modify the docker-compose.yml accordingliy. This used to work before but now it fails with errors:

102.7 Setting up fontconfig-config (2.15.0-1.1ubuntu2) ...
104.3 Illegal instruction
104.3 dpkg-maintscript-helper: error: 
104.3 dpkg: error processing package fontconfig-config (--configure):
104.3  installed fontconfig-config package post-installation script subprocess returned error exit status 1
104.3 Setting up libxcb-glx0:amd64 (1.15-1ubuntu2) ...
104.3 Setting up libedit2:amd64 (3.1-20230828-1build1) ...
104.3 Setting up libxcb-shape0:amd64 (1.15-1ubuntu2) ...
104.3 Setting up libavahi-common3:amd64 (0.8-13ubuntu6) ...
104.3 Setting up libxcb-shm0:amd64 (1.15-1ubuntu2) ...
104.3 Setting up dbus-daemon (1.14.10-4ubuntu4.1) ...
104.4 Setting up libcolord2:amd64 (1.4.7-1build2) ...
104.4 Setting up libxcb-present0:amd64 (1.15-1ubuntu2) ...
104.4 Setting up libdconf1:amd64 (0.40.0-4build2) ...
104.4 Setting up libthai0:amd64 (0.1.29-2build1) ...
104.4 Setting up ca-certificates (20240203) ...
108.9 Updating certificates in /etc/ssl/certs...
111.0 Illegal instruction
111.1 dpkg: error processing package ca-certificates (--configure):
111.1  installed ca-certificates package post-installation script subprocess returned error exit status 132

Steps To Reproduce

  • Run: curl -s "https://laravel.build/example-app?with=mariadb,redis,mailpit" | bash (works)
  • Change PHP version to 8.3 in docker-compose.yml
  • Run: sail build --no-cache (works)
  • Add line 3 to docker-compose.yml: platform: linux/x86_64
  • Run: sail build --no-cache (fails!)

Here is my complete docker-compose.yml:

services:
    laravel.test:
        platform: linux/x86_64
        build:
            context: './vendor/laravel/sail/runtimes/8.3'
            dockerfile: Dockerfile
            args:
                WWWGROUP: '${WWWGROUP}'
                MYSQL_CLIENT: mariadb-client
        image: 'sail-8.3/app'
        extra_hosts:
            - 'host.docker.internal:host-gateway'
        ports:
            - '${APP_PORT:-80}:80'
            - '${VITE_PORT:-5173}:${VITE_PORT:-5173}'
        environment:
            WWWUSER: '${WWWUSER}'
            LARAVEL_SAIL: 1
            XDEBUG_MODE: '${SAIL_XDEBUG_MODE:-off}'
            XDEBUG_CONFIG: '${SAIL_XDEBUG_CONFIG:-client_host=host.docker.internal}'
            IGNITION_LOCAL_SITES_PATH: '${PWD}'
        volumes:
            - '.:/var/www/html'
        networks:
            - sail
        depends_on:
            - mariadb
            - redis
            - mailpit
    mariadb:
        image: 'mariadb:11'
        ports:
            - '${FORWARD_DB_PORT:-3306}:3306'
        environment:
            MYSQL_ROOT_PASSWORD: '${DB_PASSWORD}'
            MYSQL_ROOT_HOST: '%'
            MYSQL_DATABASE: '${DB_DATABASE}'
            MYSQL_USER: '${DB_USERNAME}'
            MYSQL_PASSWORD: '${DB_PASSWORD}'
            MYSQL_ALLOW_EMPTY_PASSWORD: 'yes'
        volumes:
            - 'sail-mariadb:/var/lib/mysql'
            - './vendor/laravel/sail/database/mariadb/create-testing-database.sh:/docker-entrypoint-initdb.d/10-create-testing-database.sh'
        networks:
            - sail
        healthcheck:
            test:
                - CMD
                - healthcheck.sh
                - '--connect'
                - '--innodb_initialized'
            retries: 3
            timeout: 5s
    redis:
        image: 'redis:alpine'
        ports:
            - '${FORWARD_REDIS_PORT:-6379}:6379'
        volumes:
            - 'sail-redis:/data'
        networks:
            - sail
        healthcheck:
            test:
                - CMD
                - redis-cli
                - ping
            retries: 3
            timeout: 5s
    mailpit:
        image: 'axllent/mailpit:latest'
        ports:
            - '${FORWARD_MAILPIT_PORT:-1025}:1025'
            - '${FORWARD_MAILPIT_DASHBOARD_PORT:-8025}:8025'
        networks:
            - sail
networks:
    sail:
        driver: bridge
volumes:
    sail-mariadb:
        driver: local
    sail-redis:
        driver: local
@diractorhm
Copy link
Author

In the meantime we tried several Hardware combinations:

  • Ubuntu 24.04 on AMD64: works
  • Apple M1, works
  • Apple M2, works
  • Apple M3, still failing.

Since I only have one Apple M3 (MacBook Air) on hand, maybe someone reading this here who has an Apple M3 computer can try this, if it is related to the M3 chip.

We also found this article:
https://nesin.io/blog/x86-x86-amd64-docker-mac

@diractorhm
Copy link
Author

For anyone coming accross my postings here, I found the reason for my problem here:
docker/for-mac#7255 (comment)
This works for me, but I cannot tell anything about performance yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant