In this exercise, you will focus on optimizing a Docker image by minimizing its size. Using the Dockerfile from the previous exercise, "Containerizing a Legacy Application," you will learn how to reduce the image size while ensuring that the application still runs correctly. This optimization is crucial for faster deployments, lower storage requirements, and improved performance.
The original Docker image created in the previous exercise is approximately 800 MB in size. In this exercise, your goal is to significantly reduce this size.
Starting from the Dockerfile created in the previous exercise, you need to modify it to reduce the image size. The goal is to eliminate unnecessary layers and dependencies while maintaining the functionality of the Dockerized application.
To successfully complete this exercise, you need to:
https://github.com/tdevsin/docker-mastery.git
eclipse-temurin:21-jre
, which includes only the JRE (Java Runtime Environment) instead of the full JDK (Java Development Kit). This will significantly reduce the image size. Research around smaller images.