Skip to content
This repository was archived by the owner on Mar 20, 2025. It is now read-only.

File Permissions errors when using WSL 2 #3

Closed
gaambo opened this issue Sep 13, 2021 · 0 comments
Closed

File Permissions errors when using WSL 2 #3

gaambo opened this issue Sep 13, 2021 · 0 comments

Comments

@gaambo
Copy link
Owner

gaambo commented Sep 13, 2021

When using Windows Subsystem for Linux Version 2 on Windows there may be permissions error because of using the same volum on the host and in the container.
If files are owned by the host-user WordPress can't install/update/delete plugins/themes/media, when owned by the apache user (33) inside the container, the host-user can't edit the files.

I want to be able to edit theme and plugin files on my local host (IDE) and also allow WordPress to write files.
Until now I used a hacky bash-script to always overwrite the file permissions via chown and a sticky group bit, which didn't really work well.

Since this image (especially the docker-compose.development.yml) is only for local development permission escalation / security is not such a big risk. Therefore it would be easier to run the container and apache as the same user / group id as the local user.

/etc/passwd and /etc/group may need to be mounted as well (read only) to sync the user ids, depending on the host distro and the user/group id used (maybe user 1000:1000 already exists in the container?). If you encounter some file permissions about temporary files, this may be the reason.

References

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant