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
I am trying to install Laravel 9 in the docker but is facing error while installing it.
Taking 2 hours to complete this build
2
Answers
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:
(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]
I had the same issue.
When using sail you can just use:
After that the containers are created and started