I am interested in having Docker have access to external files, but I do not wish to include them as a volume. The files that I need access to will change over time, and th
I solved the same problem with below commands
docker run --mount type=bind,source="$(pwd)"/data,target=/home/data -it <name_of_container>
Note "-it conainter_name" should be the last flags.
I wonder if the ADD command could help you accomplish your goal. For instance, given the Dockerfile line:
ADD /Users/userX/myappfiles /appfiles
and the command line:
docker run myapp --input /myappfiles
myapp
would be able to access /Users/userX/myappfiles
on the local filesystem to fetch its inputs.
It sounds like mounting a host directory in the container is what you're looking for. You won't have to restart the container to pick up changes to the mounted directory. Link to relevant docs.