Git Product home page Git Product logo

Comments (1)

nicholasvad avatar nicholasvad commented on June 11, 2024

Resolution - two further findings

1. There are no permission issues on a Windows directory

Docker with WSL2 recommends that you keep files within WSL2 rather than on the Windows host.

However I tried running the above docker-compose.yml file on a folder in my Windows host, because I wanted to see if I got the same permissions errors with updates; I used Git Bash to run my docker commands in.

There were no permission errors when I updated plugins or added media files. It was quite slow, but it was workable.

2. Changing permissions to the WordPress files solved the problems for the WSL2 Linux host

This StackOverflow answer was what I needed to see.

Basically the issue was the permissions on the wpfiles directory as a shared volume which I had created and then changed to be owned by my user on the WSL2 Linux host.

To get through this, I simply entered:
$ sudo chown -R username:username wpfiles to change the ownership of those exposed files and directories in the wpfiles directory to my username.

Sadly this isn't working for me on my WSL2 Linux host if I also want to be able update plugins, themes and language files from wp-admin and to upload images.
I changed it back with:

$ sudo chown -R www-data:www-data wpfiles

There are only a few files I will want to change using VS Code: wp-config.php and my child theme are the main ones. I can just change the permissions for those to my username; there will be problems changing them from the dashboard but I can change permissions back if I want to. I can delete unwanted themes by using sudo.

That gives me nearly everything I wanted in practice and I can proceed to use this now with more confidence.

A simple solution for giving my user on the WSL2 Linux host full permissions as well as giving them ownership from Docker would be better; maybe this will be achieved soon by someone else.

from wordpress-docker-compose.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.