I am new to Docker. I have a simple Java application runs in docker. It will return an error says 4: java.io.FileNotFoundException:(No such file or directory) when the application tries to locate a file with the host path /mnt/share/abc.json.
Actually the file is exist on the location. The application help to upload files to FTP server and the file abc.json is an example of dynamic files.
Please advise how the application can locate host files in container! Thanks a lot.
Docker file as bellow
#
# Build stage
#
FROM maven:3.6.3-jdk-8 AS build
WORKDIR /home
COPY pom.xml .
RUN mvn dependency:go-offline
COPY src /home/src
RUN mvn -f /home/pom.xml clean package
#
# Package stage
#
FROM openjdk:8-jdk-alpine
COPY --from=build /home/target/*.jar app.jar
EXPOSE 8080
ENTRYPOINT ["java","-jar","/app.jar"]