I am trying to build a image for one Springboot java application using gradle 8.0.2 and java 19jdk imag
e …build is getting successful and I am able to create a image but when I login to container java jar is not running …If I manually trigger java jar application is getting started but its not getting started from the Dockerfile I am using CMD [“java”, “-jar”, “myapp.jar”]
its not getting started when I deploy on Kubernetes using the created image my pod is going in crash loopback as service is not started and getting an error in pod saying Unable to access myapp.jar
I have used ENTRYPOINT as well the container starts application when I use docker run to create a container but that also didn’t work giving same error in Kubernetes POD
I am using user root and have given executable permission to myapp.jar …The jar is available in container
Thank you. However, I could not reproduce it in my environment.
If the pod log is [Error: Unable to access jarfile myapp.jar], I think it is most likely that [/app/myapp.jar] does not exist.
Please check the following two things
Log in to the container container and make sure that /app/myapp.jar exists.
Make sure that the image you are using with Kubernetes is up-to-date
If you are still unable to do so, re-create the image and run
I created a Docker image using above Dockerfile and logged in to the container to check if app.jar is available.
app.jar file is available in Docker container whereas if I use the same image to deploy on Kubernetes and use command as an argument to check the jar and start its giving error as unable to access jar