Welcome to the Docker Image Optimization Challenge!
In today's fast-paced and ever-evolving world of software development, it has become increasingly important to create lean, performant, and efficient container images.
In this challenge, you are tasked with transforming a given Dockerfile in such a way that it significantly improves the build speed and reduces the resulting image size, while maintaining the functionality and reliability of the application contained within. You will need to employ best practices, creative thinking, and a deep understanding of Docker to achieve the most optimized Dockerfile possible.
One of the key principles of containerization is flexibility and adaptability. To make your optimized Docker image even more versatile, you will also need to implement the ability to specify the port on which the application runs through an environment variable.
To begin with on a machine with git and docker installed, clone the repository and change into the directory containing the code.
git clone https://github.com/bfritscher/guestbook-src.git cd guestbook-src/04_container_challenge
First build the code in its current state to measure initial build time and image size.
docker build -t gbc .
Check image size
docker images
Launch and test on http://localhost:5000
docker run -t -i --rm -p 5000:5000 gbc
Modify a file with an empty new line and rebuild to test rebuild time.
Edit the file Dockerfile to create an optimized version (build speed, image size and configurable PORT).
Build to time / test it.
docker build -t gbcl .
Launch it to validate that it still works, also test the new PORT environment variable
docker run -t -i --rm -e PORT=8000 -p 8000:8000 gbcl docker run -t -i --rm -e PORT=8888 -p 8888:8888 gbcl
Take a screenshot of your image sizes and upload it below.

Submit your file to https://docker-challenge.bf0.ch/