I have a Java Maven application which I used to be able to successfully build with a dockerfile but somehow now it does not work and gives me this exception:
> [14/14] COPY acs/target/dependency/ /src/lib:
------
failed to compute cache key: "/acs/target/dependency" not found: not found
Here is my Dockerfile:
#Required
FROM eclipse-temurin:16
# The jar file that will be run. This is a result of the build process
ARG JAR_FILE=target/*.jar
# The dependencies folder for all maven dependencies
ARG DEPENDENCIES=target/dependency/
# Make a directory for the jar
RUN mkdir /src
# Make a directory for the dependencies
RUN mkdir /src/lib
RUN echo "$PWD"
#Make a directoryfor the ServerConfig file
RUN mkdir -p /src/main/resources
#Echo Jar File
RUN echo $JAR_FILE
# Copy the jar from it's original location to the docker container
COPY acs/${JAR_FILE} /src/jar/
#Echo Jar File
RUN echo $(ls -1 /src/jar/)
RUN echo pwd
# Copy all of the dependencies of the jar to the docker container
COPY acs/${DEPENDENCIES} /src/lib
# The entry point is the command the docker container will run when it start, so in this case it will start the jar
ENTRYPOINT ["java","-jar","/src/jar/acs-latest.jar"]
Could you tell me why this happens?