I have tried to copy files from my windows machine to Docker container using the Docker File Command and reading those files from spring web service . Webservice throws an error file not found!
Here I am trying to copy my local directory src/nlp to /data container directoty
below are the avaialble docker volume
Docker File
FROM openjdk:8-jdk-alpine
EXPOSE 8080
ARG JAR_FILE=/target/nlp-0.0.1-SNAPSHOT.jar
ADD ${JAR_FILE} nlp-0.0.1-SNAPSHOT.jar
ADD src/nlp /data
ENTRYPOINT ["java","-jar", "nlp-0.0.1-SNAPSHOT.jar"]`
application.properties
server.port=8080
logging.level.radial.nlp=DEBUG
logging.file = mylogfile.log
nlp.learning.dir = /data/
Java
InputStream inputStream = new FileInputStream(environment.getProperty("nlp.learning.dir")+ "/train/models/en/token/en-token.bin");
Error
java.io.FileNotFoundException: /data/train/models/en/token/en-token.bin (No such file or directory)
at java.io.FileInputStream.open0(Native Method)
at java.io.FileInputStream.open(FileInputStream.java:195)
at java.io.FileInputStream.<init>(FileInputStream.java:138)