Reading file from network drive folder by java program inside docker container

Hello,
advance thank you for help me out.

I have timely manner running java program, which checks whether there is a new file in the network drive path, it is mapped like -v Y:\Temp\Sample: host/app/sample this way. There is a file with path as Y:\Temp\Sample\Test.txt
when I am running the java program it is throwing an exception as : NoSuchFileException: host/app/sample/Test.txt. I am not sure what am I missing while running the docker run command. so that Test.txt file can be read by my java program. my other requirement is, this Test.txt file is not just one to be read by my java program, if I drop other file like Test1.txt file into Y:\Temp\Sample my java program has to read that file too.

1 Like

You missed the first slash. Without it the container path is relative and not absolute.
Try -v Y:\Temp\Sample: /host/app/sample and access the file as /host/app/sample/Test.txt