I want to run my custom docker image on hidora based on platform certified images jelastic/springboot:correttojdk-17.0.8.7.1 as recommended in Setting Up Environment guide. I tested this locally with docker by running a custom container of a simple hello word web service built with gradle and spring boot 3 and it failed despite all the articles I read (Building Custom Container, Getting Started with Amazon Corretto 17 on Docker Images, Generate Single Jar Or War In Spring Boot App Using Gradle Build Tool and how to dockerize a Spring Boot application).

  • I'd generated a fat jar that I'd tested, and that works fine.
  • Then I'd created a docker file that contains the following lines:
FROM jelastic/springboot:correttojdk-17.0.8.7.1
COPY build/libs/demo-0.0.1-SNAPSHOT.jar dockerimage.jar
EXPOSE 8080
CMD ["java", "-jar", "/dockerimage.jar"]
  • Then I had built the docker image by the following command lines:
docker build . -t dockerimagejelsprgboot:v1.0
  • Then I had run a container based on the created image via docker desktop interface.

I expected to it would work fine (because I had already used other image and there was no problem) but this one failed. The container exits with this log: "2023-08-14 22:28:19 /usr/bin/java: line 73: /java.orig: No such file or directory" and I'm lost. A little help would be appreciated. Thank you.

1

There are 1 best solutions below

0
Emma Razafy On

In fact, the jelastic image requires putting our .jar file in a specific directory: "/home/jelastic/APP/" i.e. Dockerfile becomes:

FROM jelastic/springboot:correttojdk-17.0.8.7.1
COPY build/libs/demo-0.0.1-SNAPSHOT.jar /home/jelastic/APP/dockerimage.jar
EXPOSE 8080
CMD ["java", "-jar", "/home/jelastic/APP/dockerimage.jar"]