Docker is a runtime environment for building and running images and containers. Container images package applications in a standard format that can run across cloud environments. section 18.3
A minimal Dockerfile packages a Spring Boot executable JAR:
- FROM selects an image providing the OpenJDK 11 runtime. section 18.3
- ARG identifies the project JAR with a wildcard, COPY places it in the image as app.jar, and ENTRYPOINT runs it. section 18.3
Build and run an image
From the project directory, run docker build . -t habuma/tacocloud:0.0.19-SNAPSHOT, then start the container with docker run -p8080:8080 habuma/tacocloud:0.0.19-SNAPSHOT. section 18.3
FROM openjdk:11.0.12-jre
ARG JAR_FILE=target/*.jar
COPY ${JAR_FILE} app.jar
ENTRYPOINT ["java","-jar","/app.jar"]
Inspect the complete Dockerfile used to copy the built JAR and launch it with Java. section 18.3

























