Now that I found a way to expose host files to the container (-v option) I would like to do kind of the opposite:
How can I edit files from a running container with
I use sftp plugin from my IDE.
Example using sublime sftp plugin: https://www.youtube.com/watch?v=HMfjt_YMru0
If you think your volume is a "network drive", it will be easier. To edit the file located in this drive, you just need to turn on another machine and connect to this network drive, then edit the file like normal.
How to do that purely with docker (without FTP/SSH ...)?
Example:
docker run -d --name shared_vim_editor \
-v <your_volume>:/home/developer/workspace \
jare/vim-bundle:latest
docker exec -it -u root shared_vim_editor /bin/bash
Hope this helps.
The way I am doing is using Emacs with docker
package installed. I would recommend Spacemacs version of Emacs. I would follow the following steps:
1) Install Emacs (Instruction) and install Spacemacs (Instruction)
2) Add docker
in your .spacemacs
file
3) Start Emacs
4) Find file (SPC+f+f
) and type /docker:<container-id>:/<path of dir/file in the container>
5) Now your emacs will use the container environment to edit the files