I have a problem with the spring boot app below, I need to contain a spring boot app to run it locally on mac, to do it I wrote the dockerfile shown below, the container image is generated correctly but when I put it in run I have the error below, what is it due to and what can this be? to do it all I use the shell file below,how do i fix the error?
Error:
Exception in thread "main" java.lang.UnsupportedClassVersionError: com/reportserver/report/ReportApplication has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0
at java.lang.ClassLoader.defineClass1(Native Method)
docker.sh:
#!/bin/bash
#define docker name
dockername=quote
#Delete all containers and all volumes
docker system prune -a
#Build of container and image
docker build -t $dockername .
#Run container
docker run --publish 8081:8081 $dockername
Dockerfile:
FROM openjdk:alpine
EXPOSE 8081
ARG JAR_FILE=target/report-0.0.1-SNAPSHOT.jar
ADD ${JAR_FILE} app.jar
ENTRYPOINT ["java","-jar","/app.jar"]