The code must be on your computer and transferred to all the docker. This is actually pretty easy to do.
First you need to split the code with the tramp. This is done in the Vagrantfile using the synced_folder parameter. For example, if your code is in /Users/LiJung/code/ , you can try something like:
config.vm.synced_folder "/Users/LiJung/app", "/app", :nfs => true
We use NFS, because the default way to exchange folders between the host and the virtual machine (vboxfs) is dubious at best.
This will make your code available in the /app folder inside the virtual machine.
Next, you want to start the container and connect an external volume to it using the -v option:
docker run -i -t -v /app:/app <yourcontainer> /bin/bash
This will launch the container and mount the /app folder of the virtual machine into the /app folder of the container.
Now you can enjoy the comfort of your favorite editor!
Geoffrey bachelet
source share