skip to Main Content

here is my dockerfile

FROM tomcat:9
COPY ATI-0.0.1-SNAPSHOT.war /usr/local/tomcat/webapps/ATI-0.0.1-SNAPSHOT.war
CMD ["catalina.sh", "run"]

here is my docker logs
enter image description here

but no matter which path I type, an error appears
enter image description here
Tell me, is there something wrong with my dockerfile, or is my program not deployed in docker?

2

Answers


  1. Chosen as BEST ANSWER

    as a result, I just deployed the jar in a docker container using dockerfile FROM eclipse-temurin:17-jdk-alpine VOLUME /tmp COPY ATI.jar ATI.jar ENTRYPOINT ["java","-jar","/ATI.jar"] the main thing in application.properties in spring.datasource.url is to specify the correct url, I specified the IP of my computer which I learned with the help of the team ip a in linux


  2. Your Dockerfile is correct.

    You need to check which version of JDK was used to build your WAR file.

    If the JDK version isn’t supported by Tomcat 9, your application wont run. Tomcat 9 would support JDK 8

    Refer the below link and update your JDK or Tomcat version accordingly
    https://tomcat.apache.org/whichversion.html

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search