Complete the code to specify the base image for building the Spring Boot app.
FROM [1] AS buildThe base image openjdk:17-jdk-slim provides the Java 17 environment needed to build the Spring Boot app.
Complete the code to copy the Maven wrapper and project files into the build image.
COPY [1] ./Copying mvnw and pom.xml is necessary to run Maven build commands inside the image.
Fix the error in the build command to package the Spring Boot app.
RUN ./mvnw clean [1] -DskipTestscompile only compiles but does not package the jar.spring-boot:run runs the app instead of building.The install goal compiles and packages the app and installs it to the local Maven repository, which is suitable for building the jar.
Fill both blanks to specify the runtime image and copy the built jar from the build stage.
FROM [1] AS runtime COPY --from=build [2] /app/app.jar
The runtime stage uses a lightweight JRE image openjdk:17-jre-slim. The built jar is usually in the target folder after Maven build.
Fill all three blanks to complete the command that runs the Spring Boot jar with memory options.
ENTRYPOINT ["java", [1], [2], "-jar", [3]]
-jar causes errors.The ENTRYPOINT runs the jar with initial and max heap size options -Xms256m and -Xmx512m, followed by the path to the jar.