Speed up Maven Docker builds with Cache

This post will demonstrate how to speed up your maven builds using docker and buildkit as long as the docker build on the same docker host. Layer Caching With docker we know that order matters in a dockerfile, as each layer is cached, and therefore to optimise a dockerfile we set the dockerfile from least changes to most changes, as this example: FROMmaven:3.6.3-openjdk-15COPY . /appRUN mvn clean packageARG JAR_FILE=/app/target/*.jarRUN mv $JAR_FILE /app/app....

July 14, 2021 Β· 3 min Β· Ruan Bekker