[11.x] Sail Compatibility with Docker Desktop Linux. Updates TOC. #9976
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There's been a handful of issues posted about file access problems with docker on Linux. After reading through all of the issues on Laravel Sail and then other related issues posted to Docker Desktop for Linux, the actual issue is that Docker Desktop runs in a VM and doesn't have write permissions unless you explicitly set them and add the host user to that group.
The current warning on the Laravel docs doesn't resolve the issue, basically you're just disabling Docker Desktop (haha) by switching contexts, and so I removed the previous stop-gap and replaced it. Docker Desktop will only work within its desktop-linux context because it's hard coded to do so within a VM. Docker Desktop also automatically changes the context from default to desktop-linux on start and stop, so changing the context is going to be an annoying thing you have to do every time forever. The fix added via this PR makes a permanent fix until Docker adds the ability for Docker Desktop to handle additional contexts, which they don't appear to have any plans for and cite security and stability as the reasons they don't want to touch it.
Also, other solutions basically have you run sail as root or disable rootless docker, neither of which are good. The solution in this PR reasonably limits the amount of files given write access without invoking root.
I also moved it to the top under intro just below where the docs state other compatibilites. It doesn't make sense for it to be farther down the page because you can't start sail without errors unless you do this first.
This PR also updates the Sail Table of Contents.
Credit to @Ernestopheles for the original solution: cytopia/devilbox#963 (comment)
This PR likely resolves these issues:
laravel/sail#646
laravel/sail#548
laravel/sail#459
laravel/sail#457
laravel/sail#435
laravel/sail#372
laravel/sail#149
laravel/sail#81