Docker Community Forums

Share and learn in the Docker community.

Docker for windows8, File Not Found Exception IF trying to Refer Local Drive File


(Vasudevkv) #1

Docker For Windows8:
I am not able to locate the Local disk File, I have created an application which is mainly used to generate Jasper reports. I have a jrxml stored in the Local Disk E:\ Drive.
The Application is deployed in dockers successfully, But when the application is trying to access the jrxml file which i stored in Local hard drive, I am getting File not found exception. This Applicatiion is successfully running if i don’t use Dockers.


(Sam) #2

how did you tell docker where the file was? by default docker containers cannot access the host filesystem


(Vasudevkv) #3

I am using Windows 8 with tool box for Dockers. My Application is accessing The file in some path stored in E:/ Drive.
This path i am picking up from the Database. I have a table where i am configuring all my local disk path, so that i need not deploy my application for all the Path Changes, I will simply run the alter script for different environments and a reload API will be called so that the haspmap will get reloaded with the latest path.

Here please let me know for dockers to work where should i Open that particular path, so that docker container can identify the path and refer the respective file.
After reading so many articles in the net, my assumption is i should add one line in my docker file so that docker container identifies the path.
Please suggest me on this.


(Sam) #4

e:/ is on the host?

how are you passing that info to the container?

by default, containers cannot access host volumes…
you CAN pass a host folder to the container, by using the --volume,type=bind,source=e:,dest=??? as part of the docker run command.

note that I amy using the type=bind syntax, because the short syntax uses ‘:’ as the separator between source and dest, and will get confused with windows drive letter based paths…