A Dockerfile is a text configuration file that describes how to create a container image for an application. A basic Spring Boot recipe starts with an OpenJDK 11 runtime, copies the built executable JAR, and runs it when the container starts. section 18.3
FROM openjdk:11.0.12-jre
ARG JAR_FILE=target/*.jar
COPY ${JAR_FILE} app.jar
ENTRYPOINT ["java","-jar","/app.jar"]
This four-line recipe defines the runtime base, locates the project JAR, copies it as app.jar, and declares the startup command. section 18.3
The recipe connects each instruction to the image-building workflow:
- FROM selects a predefined image providing the OpenJDK 11 Java runtime. section 18.3
- ARG JAR_FILE uses target/*.jar so the definition does not depend on a specific JAR name or version. section 18.3
- COPY places the built JAR in the image under the generic name app.jar. section 18.3
- ENTRYPOINT runs java -jar /app.jar when a container created from the image starts. section 18.3
Build and run the image
After building the application JAR, run docker build . -t habuma/tacocloud:0.0.19-SNAPSHOT, then start it with docker run -p8080:8080 habuma/tacocloud:0.0.19-SNAPSHOT. section 18.3

















