1

I'm using PhpStorm with Docker plugin.

I'm connecting to my docker daemon via "Docker for Windows".

I can view the files from container in editor but I cannot modify them. In VS Code I can modify them. Is it possible to do so in PhpStorm as well, and how?

LazyOne
  • 158,824
  • 45
  • 388
  • 391
user8555937
  • 2,161
  • 1
  • 14
  • 39
  • Are you running vscode as admin / a user with elevated permissions? People usually run their docker containers as root, (which I don't prefer personally) and you try to access / edit files in it as a normal user,it will cause permission issues. – Hisham Jul 23 '21 at 08:02
  • Running it as normal user. Tried to run Storm as administrator but problem persists. – user8555937 Jul 23 '21 at 08:36

1 Answers1

3

No, it's not possible in PhpStorm. A possibility to edit & save files in a container is being worked on, see https://youtrack.jetbrains.com/issue/IDEA-176734#focus=Comments-27-3565950.0-0.

There are two possible workarounds:

  • You can try editing your files with a host editor.

How to edit Docker container files from the host?

  • You can try running docker cp command to get the file out of the container, then editing it and copying it back and restarting the container.

How to edit files in stopped/not starting docker container

Anastasiia
  • 31
  • 2