Download the official NGINX image from Docker Hub using:
docker pull nginx




Create a Dockerfile using Ubuntu as base image and install NGINX.

Build the custom image using:
docker build -t nginx-ubuntu .

Run the Ubuntu-based NGINX container.
docker run -d -p 8081:80 --name nginx-ubuntu-container nginx-ubuntu

Open browser and access:
http://localhost:8081


Build the image using:
docker build -t nginx-alpine .

Run the Alpine-based container.

Open browser and access:
http://localhost:8082

Observe startup time, storage size, and efficiency of each image.

NGINX web server was successfully deployed using:
The experiment demonstrated that Alpine-based images are smaller and more lightweight, while Ubuntu-based images offer greater flexibility with increased size. The official NGINX image provides an optimized and production-ready solution.
This experiment highlights the importance of selecting an appropriate base image in Docker. Alpine images offer reduced size and improved efficiency, Ubuntu provides flexibility, and the official NGINX image ensures stability and production readiness. Understanding these differences helps in optimizing containerized application deployments.