I can't copy file from outsite of dockerfile's folder. I'm getting error from docker-compose build:
failed to compute cache key: failed to walk /var/lib/docker/tmp/buildkit-mount196528245/target: lstat /var/lib/docker/tmp/buildkit-mount196528245/target: no such file or directory
ERROR: Service 'discovery' failed to build : Build failed
There is the folder structure
discovery
-docker
Dockerfile
-target
discovery.jar
This is Dockerfile
FROM openjdk:11
ARG JAR_FILE=../target/discovery.jar
COPY ${JAR_FILE} app.jar
ENTRYPOINT ["java", "-jar", "app.jar"]
and this is my docker-compose file
services:
discovery:
build: ./discovery/docker
ports:
- 8761:8761
Thank in adance for help.