Docker Volume usage

Docker volume is throwing file not found

i want to schedule a job using aws batch job, for that i am preparing a docker file which run below script

FROM openjdk:jdk-alpine

Environment Variables

RUN mkdir -p /usr/local/applmgr/apps/company/fol-ups/

ADD fol-ups/ /usr/local/applmgr/apps/company/fol-ups/

VOLUME ["/usr/local/applmgr/apps/company/fol-ups/"]

RUN ls -la /usr/local/applmgr/apps/company/fol-ups/*

ADD fol-ups.jar /usr/local/applmgr/apps/company/fol-ups/fol-ups.jar

env company_UTILITIES = /usr/local/applmgr/apps/company/

CMD echo $company_UTILITIES

CMD java -jar /usr/local/applmgr/apps/company/fol-ups/fol-ups.jar --startDate=2016-10-01 --endDate=2016-10-07

Here i am creating a volume and copying my file structure to that volume and printing the content which work fine.

but when i run docker image application, it throws file in the folder doesn’t exist or file not found

can some help ,me to fix this.

below is the error

org.springframework.beans.factory.BeanDefinitionStoreException: Failed to parse configuration class [com.company.ups.folUpsApplication]; nested exception is java.io.FileNotFoundException: = /usr/local/applmgr/apps/company/fol-ups/config/application.properties (No such file or directory)
at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:181) ~[spring-context-4.3.9.RELEASE.jar!/:4.3.9.RELEASE]

I’m pretty sure this sequence of steps isn’t doing what you expect. Dockerfile reference | Docker Docs has details.

I’d also guess you don’t want this to be a volume: it looks like it’s part of the application source, and if the application and the underlying image changes, you want what’s in the image, not what’s left over in the volume from the last time you ran it.

Re :

Yes i didn’t want to use volume,but want the use the Application configuration which is in image which i created, but not able to retrieve the configuration as it is created in different containers.

how to retrieve the application configuration which is throwing file not found.