Complete the code to define a Spring Boot application main class.
public class Application { public static void main(String[] args) { SpringApplication.[1](Application.class, args); } }
The SpringApplication.run() method starts the Spring Boot application.
Complete the Dockerfile line to specify the base image for a Spring Boot app.
FROM [1]Spring Boot apps run on Java, so the base image should be a Java JDK image like openjdk:17-jdk-slim.
Fix the error in the Dockerfile command to copy the jar file.
COPY target/[1] /app/app.jarThe jar file built by Spring Boot is commonly named app.jar in this example, so the COPY command must match the actual jar filename.
Fill both blanks to complete the Dockerfile command that runs the Spring Boot app.
ENTRYPOINT ["java", "[1]", "[2]"]
The ENTRYPOINT runs the jar with java -jar app.jar.
Fill all three blanks to create a Docker command that builds and runs the container.
docker [1] -t springboot-app . && docker [2] -d -p [3]:8080 springboot-app
First, build the image with docker build. Then run it detached with docker run -d mapping port 8080.