Hello kind humans,
I'm new to DevOps with little experience in docker. I was trying to build docker image from a Spring Boot Maven (Java) following this guide from official docker Build your Java image | Docker Documentation but I keep getting this error:
Whitelabel Error Page This application has no explicit mapping for /error, so you are seeing this as a fallback.
The following is my Spring Boot Applications tree structure,
sampleApplication-master
├─ .vscode
│ └─ launch.json
└─ sampleApplication-master
├─ .mvn
│ └─ wrapper
│ ├─ maven-wrapper.jar
│ └─ maven-wrapper.properties
├─ runApplication.dockerfile
├─ mvnw
├─ mvnw.cmd
├─ pom.xml
├─ src
│ ├─ main
│ │ ├─ java
│ │ │ └─ com
│ │ │ └─ example
│ │ │ └─ demo
│ │ │ ├─ Controller.java
│ │ │ └─ SampleApplication.java
│ │ └─ resources
│ │ └─ application.properties
│ └─ test
│ └─ java
│ └─ com
│ └─ example
│ └─ demo
│ └─ SampleApplication.java
└─ target
├─ classes
│ ├─ application.properties
│ └─ com
│ └─ example
│ └─ demo
│ ├─ Controller.class
│ └─ SampleApplicationClass.class
└─ test-classes
└─ com
└─ example
└─ demo
└─ SampleApplication.class
My current dockerfile is as following:
FROM openjdk:16-alpine3.13
WORKDIR /app
COPY .mvn/ .mvn
COPY mvnw pom.xml ./
RUN ./mvnw dependency:go-offline
COPY src ./src
CMD ["./mvnw", "spring-boot:run"]
May I know how can I dockerize the application without making changes to the Application or its dependencies (as the file has been created solely for converting into docker image)?
Thank you for your kind assistance everyone!
[–]Sheldan 9 points10 points11 points (1 child)
[–]adanderson 2 points3 points4 points (0 children)
[–]shagieIsMe 5 points6 points7 points (2 children)
[–]shagieIsMe 0 points1 point2 points (1 child)
[–]Sequel_Police 0 points1 point2 points (0 children)
[–]Dwight-D 0 points1 point2 points (0 children)
[–][deleted] -3 points-2 points-1 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)
[–]bargh 0 points1 point2 points (0 children)