I am facing the following problems while making the Dockerfile
1. First approach - Create a jar file of the app and run.
Issue - There is no manifest file. I tried adding a manifest file using the command - jar -cvfm example.jar manifest.txt *.java
Manifest file contents-
Created-By: 1.8.0_171 (Oracle Corporation)
Got the below error on running
java -jar example.jar
Error: Could not find or load main class org.apache.juneau.petstore.App
2. Second approach - Run the application with mvn spring-boot:run
Issue - On running the docker image I get the below error
SEVERE: Application run failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'petStoreService' defined in class path resource [org/apache/juneau/petstore/AppConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.apache.juneau.petstore.service.PetStoreService]: Factory method 'petStoreService' threw exception; nested exception is java.lang.NoClassDefFoundError: javax/xml/bind/JAXBException
The app runs locally with the mvn command.
Then run the below commands inside juneau-petstore directory.
docker build . -t image
docker run --rm -it image:latest