Date: 2/2/2026 Author: Divyanshu Gaur
The objective of this lab is to:
The first step involves fetching the Nginx image from Docker Hub
docker pull nginx
Execution Screenshot:

The container is started in detached mode with host port 8080 mapped to container port 80.
docker run -dp 8080:80 nginxExecution Screenshot:

To confirm the container is active and check the assigned status and ports, the ps command is used[cite: 15].
docker psExecution Screenshot:

To manage the lifecycle, the container is stopped first and then removed using its ID.
docker stop 432421f52b7bdocker rm 432421f52b7bStop Screenshot:

Remove Screenshot:

The final step in the lifecycle management is removing the image from the local repository.
docker rmi nginxExecution Screenshot:

Docker images were successfully pulled, containers executed, and lifecycle commands performed.
This lab demonstrated containerization using Docker, highlighting clear performance and resource efficiency. Containers are better suited for rapid deployment and microservices, whereas VMs provide stronger isolation.