skip to Main Content

I’m trying install laravel package via composer in WSL 2 docker with sail laravel CLI, but composer not install package, why?

Error screenshot
enter image description here

docker file

# For more information: https://laravel.com/docs/sail
version: '3.8'
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_HOST: '${DB_HOST}'
            MYSQL_ALLOW_EMPTY_PASSWORD: 'yes'
        volumes:
            - 'sailmysql:/var/lib/mysql'
        networks:
            - sail
    phpmyadmin:
        image: 'phpmyadmin'
        container_name: pma
        environment:
            PMA_HOST: '${DB_HOST}'
            PMA_PASSWORD: '${DB_PASSWORD}'
            PMA_ARBITRARY: 1
        restart: always
        ports:
            - 8081:80
        depends_on:
            - mysql
        networks:
            - sail
networks:
    sail:
        driver: bridge
volumes:
    sailmysql:
        driver: local
    sailredis:
        driver: local

information

  • windows version 10 build 19042
  • debian wls 2
  • docker 20.10.2, build 2291f61
  • laravel 8
  • composer integrated with laravel 2.0.8

how do I solve this?

2

Answers


  1. Chosen as BEST ANSWER

    I solved that. Deleted folder vendor, and run composer install, that worked. thank so much childs


  2. I had the same problem as well, but when I fixed the file permissions, it was fixed.
    https://devblogs.microsoft.com/commandline/chmod-chown-wsl-improvements/

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search