Reputation: 546
I am novice to Spring Boot Microservices and Docker.
The dockerfile in microservice project:
docker build:
docker images:
when running the image, there is an error: Unable to access jarfile register_server.jar
Cheers, Sean
Upvotes: 8
Views: 26922
Reputation: 1853
You need to specify either the absolute target path or set the WORKDIR
https://docs.docker.com/engine/reference/builder/#add
The <dest>
is an absolute path, or a path relative to WORKDIR
, into which the source will be copied inside the destination container. For example:
ADD test relativeDir/ # adds "test" to `WORKDIR`/relativeDir/
ADD test /absoluteDir/ # adds "test" to /absoluteDir/
Upvotes: 5