0
0
Spring Bootframework~10 mins

Why containerization matters in Spring Boot - Test Your Understanding

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to define a Spring Boot application main class.

Spring Boot
public class Application {
    public static void main(String[] args) {
        SpringApplication.[1](Application.class, args);
    }
}
Drag options to blanks, or click blank then click option'
Alaunch
Bstart
Cexecute
Drun
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'start' or 'launch' instead of 'run' causes errors.
2fill in blank
medium

Complete the Dockerfile line to specify the base image for a Spring Boot app.

Spring Boot
FROM [1]
Drag options to blanks, or click blank then click option'
Anode:latest
Bubuntu:20.04
Copenjdk:17-jdk-slim
Dpython:3.12
Attempts:
3 left
💡 Hint
Common Mistakes
Choosing non-Java images like Node or Python causes build failures.
3fill in blank
hard

Fix the error in the Dockerfile command to copy the jar file.

Spring Boot
COPY target/[1] /app/app.jar
Drag options to blanks, or click blank then click option'
Aapp.jar
Bapplication.jar
Cmyapp.jar
Dspringboot.jar
Attempts:
3 left
💡 Hint
Common Mistakes
Using wrong jar file names causes Docker build errors.
4fill in blank
hard

Fill both blanks to complete the Dockerfile command that runs the Spring Boot app.

Spring Boot
ENTRYPOINT ["java", "[1]", "[2]"]
Drag options to blanks, or click blank then click option'
A-jar
Bapp.jar
C-cp
Dtarget/app.jar
Attempts:
3 left
💡 Hint
Common Mistakes
Using '-cp' instead of '-jar' or wrong jar file path.
5fill in blank
hard

Fill all three blanks to create a Docker command that builds and runs the container.

Spring Boot
docker [1] -t springboot-app . && docker [2] -d -p [3]:8080 springboot-app
Drag options to blanks, or click blank then click option'
Abuild
Brun
C8080
Dstart
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'start' instead of 'run' or wrong port mapping.