Docker documentation says that it\'s possible to mount a single file into a Docker container:
The -v flag can also be used to mount a single file - in
When running docker inside docker (by mounting /var/run/docker.sock for example), you need to be aware that if you do mounts inside docker, the filepaths that are used are always the one on your host.
So if on your host you do the following mount :
-v /tmp/foobar.txt:/my/path/foobar.txt
you should not do the following mount inside docker :
-v /my/path/foobar.txt:/my/other/path.txt
but instead, use the host filepath, eg :
-v /tmp/foobar.txt:/my/other/path.txt