1

How can I copy the jar file without specifying the version in the copy command?

Below is the original command

COPY web-app/target/web-app-0.0.1-SNAPSHOT-exec.jar /web-service.jar

Thank you

David
  • 607
  • 1
  • 6
  • 19

1 Answers1

0

I use that docker file in my spring projects: with a docker compose up command it runs.

FROM openjdk:8
ADD dockerspringboot.jar dockerspringboot.jar
EXPOSE 8094
ENTRYPOINT ["java", "-jar", "dockerspringboot.jar"]
Fatih Bayhan
  • 141
  • 1
  • 3
  • I should use the Add command instead of Copy, and I don't need to care about the version number? Please advise. – David Mar 02 '22 at 06:01
  • 1
    Why don't you use wild cards ? https://stackoverflow.com/questions/45786035/docker-copy-with-folder-wildcards – Tomz Mar 02 '22 at 07:46