There is another way to start container with volume from another container:
Look at
https://docs.docker.com/userguide/dockervolumes/
Creating and mounting a Data Volume Container
If you have some persistent data that you want to share between containers, or want to use from non-persistent containers, it's best to create a named Data Volume Container, and then to mount the data from it.
Let's create a new named container with a volume to share.
$ sudo docker run -d -v /dbdata --name dbdata training/postgres echo Data-only container for postgres
You can then use the --volumes-from flag to mount the /dbdata volume in another container.
$ sudo docker run -d --volumes-from dbdata --name db1 training/postgres
And another:
$ sudo docker run -d --volumes-from dbdata --name db2 training/postgres
Another useful function we can perform with volumes is use them for backups, restores or migrations. We do this by using the --volumes-from flag to create a new container that mounts that volume, like so:
$ sudo docker run --volumes-from dbdata -v $(pwd):/backup ubuntu tar cvf /backup/backup.tar /dbdata
=============
I think you should not use mounting of your host directory to a container.
But you can use volumes with all its powers.
You can edit files in volumes using other containers with perfect set of your editors and tools. And container this your app will be clean without overhead.
Structure is:
-) Container for app data
docker run -d -v /data --name data
-) Container for app binaries
docker run -d --volumes-from data --name app1
-) Container for editors and utilities for development
docker run -d --volumes-from data --name editor