Firstly, this PR fixes a bug where the command sail root-shell does not open a root shell for containers that are not running as the root user (by switching users with USER <user> in the Dockerfile). The simple fix is to just specify the root user in the command.
Secondly, this PR replaces the hardcoded sail user with the (unused) WWWUSER variable that's already defined in the sail script:
This gives the developer greater flexibility and allows the sail script to work with containers that don't have a sail user defined. For example, the project I work on has its own Dockerfiles and custom user, the only reason why I use this package is for the neat sail command to easily proxy commands into the containers---however, I can't use the script as-is due to the hardcoded sail user which doesn't exist inside the container.
Hello!
Firstly, this PR fixes a bug where the command
sail root-shell
does not open a root shell for containers that are not running as the root user (by switching users withUSER <user>
in the Dockerfile). The simple fix is to just specify theroot
user in the command.Secondly, this PR replaces the hardcoded
sail
user with the (unused)WWWUSER
variable that's already defined in thesail
script:https://github.com/laravel/sail/blob/7150fe03a94e7cd77b8042ddbb55c7ed20c4bca0/bin/sail#L137-L142
This gives the developer greater flexibility and allows the
sail
script to work with containers that don't have asail
user defined. For example, the project I work on has its own Dockerfiles and custom user, the only reason why I use this package is for the neatsail
command to easily proxy commands into the containers---however, I can't use the script as-is due to the hardcodedsail
user which doesn't exist inside the container.Thanks!