CONTAINERIZATION PRACTICAL ASSIGNMENT
Topic: Introduction to Containers Using Docker
Assignment 1 Term Two: Containerize a Simple Web Application
Objective
To learn how to package and run applications inside containers.
Required Tools
• Docker Desktop
• Visual Studio Code
• GitHub Account
Step 1: Create a Simple Website
Create a folder named 'mywebsite'. Inside it, create an [Link] file containing a simple web
page.
Step 2: Create a Dockerfile
Create a file named Dockerfile and add:
FROM nginx:latest
COPY [Link] /usr/share/nginx/html/[Link]
Step 3: Build the Docker Image
Run: docker build -t mywebsite .
Step 4: Run the Container
Run: docker run -d -p 8080:80 mywebsite
Step 5: Access the Application
Open a browser and visit: [Link]
Step 6: Verify the Container
Run: docker ps and take a screenshot of the running container.
Step 7: Push to GitHub
git init
git add .
git commit -m 'My Docker Website'
git remote add origin YOUR_REPOSITORY_URL
git push -u origin main
Short Report
What are Containers?
Containers are lightweight software packages that include an application and all its dependencies,
enabling it to run consistently across different environments.
Benefits of Containerization
• Fast deployment
• Portability
• Efficient resource usage
• Easy scaling
• Consistent environments
Challenges Encountered
• Installing Docker
• Learning Docker commands
• Configuring ports
• Connecting Docker with GitHub
Expected Deliverables
• Source code
• Dockerfile
• Screenshot of running container
• GitHub repository link
• Short report