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
Open File Explorer and the folder that includes your JarFile. Right-click the Jar file and select Open with then Choose another app. Select Java if it's listed among the default programs.
Differences between CMD & ENTRYPOINT CMD commands are ignored by Daemon when there are parameters stated within the docker run command while ENTRYPOINT instructions are not ignored but instead are appended as command line parameters by treating those as arguments of the command.
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/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With