Skip to content
Advertisement

Laravel Sail is not running on my macbook m1

I tried using Laravel 8 Sail on my Mac M1 Computer. I have successfully installed docker , php 7.4 & used composer to install Laravel. I am trying to use sail but I am stuck at the part which says

Could not open input file: /var/www/html/artisan

Below are the details:

Here is the docker file:

# For more information: https://laravel.com/docs/sail
version: '3'
services:
    laravel.test:
        build:
            context: ./vendor/laravel/sail/runtimes/7.4
            dockerfile: Dockerfile
            args:
                WWWGROUP: '${WWWGROUP}'
        image: sail-8.0/app
        ports:
            - '${APP_PORT:-80}:80'
        environment:
            WWWUSER: '${WWWUSER}'
            LARAVEL_SAIL: 1
        volumes:
            - '.:/var/www/html'
        networks:
            - sail
        depends_on:
            - mariadb
    mariadb:
        image: 'mariadb:10'
        ports:
            - '${FORWARD_DB_PORT:-3306}:3306'
        environment:
            MYSQL_ROOT_PASSWORD: '${DB_PASSWORD}'
            MYSQL_DATABASE: '${DB_DATABASE}'
            MYSQL_USER: '${DB_USERNAME}'
            MYSQL_PASSWORD: '${DB_PASSWORD}'
            MYSQL_ALLOW_EMPTY_PASSWORD: 'yes'
        volumes:
            - 'sailmariadb:/var/lib/mysql'
        networks:
            - sail
        healthcheck:
          test: ["CMD", "mysqladmin", "ping", "-p${DB_PASSWORD}"]
          retries: 3
          timeout: 5s
networks:
    sail:
        driver: bridge
volumes:
    sailmariadb:
        driver: local


After running the command ./vendor/bin/sail up on my rosetta terminal , I am getting the following error:

laravel.test_1  | 2021-07-26 18:19:35,319 INFO Set uid to user 0 succeeded
laravel.test_1  | 2021-07-26 18:19:35,320 INFO supervisord started with pid 17
laravel.test_1  | 2021-07-26 18:19:36,332 INFO spawned: 'php' with pid 18
laravel.test_1  | Could not open input file: /var/www/html/artisan
laravel.test_1  | 2021-07-26 18:19:36,383 INFO exited: php (exit status 1; not expected)
laravel.test_1  | 2021-07-26 18:19:37,395 INFO spawned: 'php' with pid 19
laravel.test_1  | Could not open input file: /var/www/html/artisan
laravel.test_1  | 2021-07-26 18:19:37,433 INFO exited: php (exit status 1; not expected)
laravel.test_1  | 2021-07-26 18:19:39,447 INFO spawned: 'php' with pid 20
laravel.test_1  | Could not open input file: /var/www/html/artisan
laravel.test_1  | 2021-07-26 18:19:39,483 INFO exited: php (exit status 1; not expected)
laravel.test_1  | 2021-07-26 18:19:42,501 INFO spawned: 'php' with pid 21
laravel.test_1  | Could not open input file: /var/www/html/artisan
laravel.test_1  | 2021-07-26 18:19:42,538 INFO exited: php (exit status 1; not expected)
laravel.test_1  | 2021-07-26 18:19:43,543 INFO gave up: php entered FATAL state, too many start retries too quickly

Advertisement

Answer

After many tries , I discovered that the mounting of shared drive has issues due to permission. My project folder was in Document >> LaraProjects. I had to manually add the file sharing. So here is what I did :

Under the Docker Dashboard > settings > Resources > File Sharing , I clicked the plus sign to add directory and added Documents >> LaraProjects and it worked.

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement