File permissions with docker image

Hi
I followed the instructions for installing the docker image on linux using Desktop Docker for Linux and all went ok, and you are right, it is very fast.

However I cannot change the files because I get a file permission error. Even editing in a simpler text editor is a problem but PHPStorm complains as well.

Have I missed a step?

Andy

Hi @axomat, just to clarify, you are using the simplest Docker Desktop method, where all files are stored in the container? How do you edit the files? Are you using the “Attach to Running Container” command in Visual Studio Code or a similar editor? I’d try to connect to the container shell and change file permissions in the October CMS installation directory: chmod -R 777 /var/www/html.

If it doesn’t work, you can try the method where files are stored on your host system. In the documentation the method is called “Interactive bash script”. With the files on the host system, you can set file permissions with chmod as you need.

I did follow the interactive method, and I have set the permissions to 777. October runs fine, the database is installed correctly. The only issue is that when I use phpstorm (or any text editor) it reports that the file is read-only. As I am running with a linux host, the documentation for docker tells me that I should be able to access the whole of the container filesystem without any further configuration, thats why I presumed that the issue was caused by the default user/permissions used within the container being incorrect, or maybe I need to add the container user to a host group, I dont know. I also dont know what the vscode Attach to Running Container does, phpstorm can attach to the container and control it ok (although for anyone else trying, phpstorm uses an incorrect docker location so you have to create a symlink to the correct location).
I am a bit stuck now, I really want to move away from vagrant / homestead which is so slow but maybe I will to stick with that.
Thanks for any suggestions

Hi @axomat, I’m sorry for the late reply. If your host machine runs Linux, you should be able to edit files directly on the host filesystem, and you can manage file permissions as you usually do. The interactive script creates a directory on the host, and installs October CMS into it. You can change permissions on the entire octobercms-files directory.

Thank you, yes that is the solution. I have now moved to the Sail version of October CMS and that has been a smoother process, maybe I am more familiar with Docker now but anyhow I am up and running and I recommend using Docker over Homestead/Vagrant to anyone thinking of the move.