Dockerizing Spring Boot Error: Unable to access jarfile /app.jar

  docker, java, spring-boot

Dockerfile

FROM openjdk:17
ARG JAR_FILE=target/*.jar
COPY ${JAR_FILE} app.jar
ENTRYPOINT ["java", "-jar", "/app.jar"]

Built with docker build -t rad4rman/coding-task .

Ran with docker run -p 8080:8080 rad4rman/coding-task

And receiving error Error: Unable to access jarfile /app.jar

Any ideas on what I’m doing wrong?

Source: Docker Questions

LEAVE A COMMENT