Description
Right now trying to ADD a fully qualified file name (FQFN), e.g. /home/mydir/testfile will fail with the error "no such file or directory".
The failure is on purpose for security reasons. From @tianon: Imagine that I have a Dockerfile that does "ADD /etc/shadow /my/path \n RUN some-command-to-upload-your-etc-shadow-to-my-server".
However at the least the message is wrong and should be something like "forbidden path outside the context". Consider that the client might be remote from the docker daemon.
However if you have common files (tar, configuration, html etc.) that you may wish to include in multiple images, then you need to duplicate these files into each build directory. One could image having a shared file system with lots of common files that are required for different classes of images or for all images (maybe some legal/copywrite document).
How can we maintain the security while at the same time solve the problem of having common files ADDed from one place.
Perhaps we could check to see if the (FQFN) is on a mounted device and allow that? Or some other magic.