简体   繁体   中英

laravel, sail shell and sail artisan command stop working

sail shell and sail artisan command has stop working.

But sail up and sail down are still working.

Version details

php: 8.0.5
laravel: 8.41.0
sail: 1.5.1
docker: 3.3.3
os: macOS 11.3.1

My docker-compose.yml file

# For more information: https://laravel.com/docs/sail
version: '3'
services:
    laravel.test:
        build:
            context: ./vendor/laravel/sail/runtimes/8.0
            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:
            - mysql
    mysql:
        image: 'mysql:8.0'
        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:
            - 'sailmysql:/var/lib/mysql'
        networks:
            - sail
        healthcheck:
          test: ["CMD", "mysqladmin", "ping", "-p${DB_PASSWORD}"]
    meilisearch:
        image: 'getmeili/meilisearch:latest'
        ports:
            - '${FORWARD_MEILISEARCH_PORT:-7700}:7700'
        volumes:
            - 'sailmeilisearch:/data.ms'
        networks:
            - sail
    mailhog:
        image: 'mailhog/mailhog:latest'
        ports:
            - '${FORWARD_MAILHOG_PORT:-1025}:1025'
            - '${FORWARD_MAILHOG_DASHBOARD_PORT:-8025}:8025'
        networks:
            - sail
    myadmin:
        image: 'phpmyadmin:latest'
        ports:
            - '${PHP_MYADMIN_PORT:-8080}:80'
        environment:
            MYSQL_ROOT_PASSWORD: '${DB_PASSWORD}'
        links:
            - "mysql:db"
        depends_on:
            - mysql
        networks:
            - sail
networks:
    sail:
        driver: bridge
volumes:
    sailmysql:
        driver: local
    sailmeilisearch:
        driver: local

My env. file

APP_PORT=81
FORWARD_DB_PORT=3305
PHP_MYADMIN_PORT=8081
FORWARD_MEILISEARCH_PORT=7701
FORWARD_MAILHOG_PORT=1026
FORWARD_MAILHOG_DASHBOARD_PORT=8026
WWWGROUP=1000
WWWUSER=1000

As we can see sail command are not working in image, it return empty.

在此处输入图像描述

Thankyou.

I think the problem is about the name of the service. The name have to match in files docker-compose.yml and.env

1/ Stop sail > sail down

2/ docker-compose.yml

version: '3'

services:
    your-app.test:

3/ add this in.env

APP_SERVICE="your-app.test"

4/ sail up

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM