Either your question is unclear to me; or your docker installation has a bug.
I think you want to do this:
- Start a container, binding a host file into the container.
- Be able to edit the file inside the container, and reflect those edits in the "host version" of the file.
On my machine (bog standard Docker installation), the following command line achieves exactly what you're asking:
docker run -v /tmp/host.txt:/tmp/container.txt -it --rm alpine sh
I can then edit either /tmp/host.txt on the host, or /tmp/container.txt within the container, and the changes are immediately reflected on the other side. In fact, technically, the two files physically are the same, just hidden behind layers and layers of the "onion" magic of Docker.
Adding :ro to the argument of -v does as expected - it makes the file read-only, and if I try to edit it anyways, the editor shows the message "read-only filesystem", as it should be.
Note that this style of -v is a bind mount in the parlance of Docker (in the case of volume mounts there is no "host version" of the mounted directory/files, so none of this applies).
If nothing of this helps please clarify your question.