1

My goal is to create a Docker image. However, the ./mvnw install takes way too long time.

What I've did:

  1. I tried to run java com.personal.bebankaccount.BeBankaccountApplication.java. It throws:
    Error: Could not find or load main class 
    com.personal.bebankaccount.BeBankaccountApplication.java
    Caused by: java.lang.ClassNotFoundException: 
    com.personal.bebankaccount.BeBankaccountApplication.java
    

I use IntelliJ IDEA and pressing CTRL+R will run the application. However, the problem is I am want to run this application on a Docker image.

Jason Rich Darmawan
  • 1,607
  • 3
  • 14
  • 31
  • See https://stackoverflow.com/questions/22886083/how-do-i-run-a-spring-boot-executable-jar-in-a-production-environment By the way, the `java` command takes a class name, not a source file name. – tgdavies Jun 26 '22 at 06:47
  • How did you run it, using this command - ./mvnw spring-boot:run ? – Tsvetoslav Tsvetkov Jun 26 '22 at 06:47
  • @TsvetoslavTsvetkov I run it with either of these, `CTRL+R` while inside IntelliJ IDEA or create docker image. The docker image take way too long time on step `./mvnw install`. – Jason Rich Darmawan Jun 26 '22 at 06:51
  • @kidfrom this command runs the application as a Stand alone project. If you need to run it in a docker file, you should build the app and make a docker file using an already created the jar. Let me know if you need more details on that – Tsvetoslav Tsvetkov Jun 26 '22 at 06:56
  • @TsvetoslavTsvetkov I did build the app. However, my Mac Mini M1 are having issue to create the `.jar`. So,I handle everything inside `Dockerfile`. I uploaded the [Dockerfile file](https://github.com/kidfrom/be-bankaccount/blob/master/Dockerfile) for reference. – Jason Rich Darmawan Jun 26 '22 at 09:39

0 Answers0