skip to Main Content

I am getting an error while installing Laravel in Docker.

I followed the instruction from https://laravel.com/docs/9.x/installation

Error:
CACHED [ 5/11] RUN setcap "cap_net_bind_service=+ep" /usr/bin/php8.1                                                                                                                                      0.0s
ERROR [ 6/11] RUN groupadd --force -g  sail                                                                                                                                                               0.9s
> ------
6/11] RUN groupadd --force -g  sail:
> #0 0.835 groupadd: invalid group ID 'sail'
> ------
failed to solve: executor failed running [/bin/sh -c groupadd --force -g $WWWGROUP sail]: exit code: 3

your textenter image description here

I am trying to install Laravel 9 in the docker but is facing error while installing it.

Taking 2 hours to complete this build

enter image description here

2

Answers


  1. You are missing the WWWGROUP env-variable in your host environment, so the docker container will not be able to map your host group to your container group.

    add the following 2 variables to your .env file:

    WWWGROUP=1000
    WWWUSER=1000
    

    (if you have other ids in your O/S), then replace 1000 with correct ID for the group and user you wish to use.

    On ubuntu you can check this with following command:

    $ id [username]

    Login or Signup to reply.
  2. I had the same issue.

    When using sail you can just use:

    sail up -d
    

    After that the containers are created and started

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