Created
October 4, 2024 23:09
-
-
Save MarceloZapatta/2f5e031b64263ab7cb4611caac88e91d to your computer and use it in GitHub Desktop.
Laravel Sail fix permissions
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 1. Build with sail | |
| ./vendor/bin/sail up -d | |
| 2. Enter the shell and change the owner | |
| ./vendor/bin/sail root-shell | |
| cd .. | |
| chown -R sail:sail html | |
| 3. Check in the host machine the GID and UID (outside docker/sail) | |
| ls -la | |
| // 100999:100999 | |
| 4. If the owner is like this 100999 100999 | |
| 4.1 check if the sail group already exists | |
| grep sail /etc/group | |
| 4.2 If exists but the GID is different from 100999 change it manually | |
| 4.3 If not exists create a new sail group with the right GID | |
| sudo groupadd -g <gid> <group> | |
| sudo groupadd -g 100999 sail | |
| 4.4 Create the sail user if not exists | |
| sudo adduser sail --disabled-password | |
| 4.4 Add sail user and current user | |
| sudo usermod -aG sail sail | |
| sudo usermod -aG sail ${USER} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment