Concept
A container image bundles the JVM, your jar and its configuration so it runs identically everywhere. A multi-stage Dockerfile builds in one stage and ships only the runtime in the other.
The tutor works through these with you, in conversation and code. A session ends when you have shown them, not when a video does.
A few lines that show Containerising with Docker doing its job.
FROM eclipse-temurin:21-jdk AS build
WORKDIR /src
COPY . .
RUN ./mvnw -q package -DskipTests
FROM eclipse-temurin:21-jre
WORKDIR /app
COPY --from=build /src/target/*.jar app.jar
USER 1000
EXPOSE 8080
ENTRYPOINT ["java", "-XX:MaxRAMPercentage=75", "-jar", "app.jar"]Shipping the JDK build image as the runtime, or running as root. The image is hundreds of megabytes larger than it needs to be, and a compromise in the container has root.
Your roadmap puts these before Containerising with Docker, unless you already know them.
Once a session shows you understand Containerising with Docker, it comes back for review. Each review takes a minute and tells the memory model how well you still know it.
Topics that build on Containerising with Docker.