The way docker look for file is from the current directory i.e. if your command is
COPY target/xyz.jar app.jar
ADD target/xyz.jar app.jar
The xyz jar should be in the current/target directory - here current is the place where you have your docker file. So if you have docker in a different dir. its better bring to main project directory and have a straight path to the jar being added or copied to the image.