0% found this document useful (0 votes)
5 views

Containerization

Uploaded by

sodayac916
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views

Containerization

Uploaded by

sodayac916
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

This document is the property of Al Nafi.

Any unauthorized redistribution or reproduction, including in printed form, is strictly


prohibited. This document can only be read electronically.

Lab 17: Virtualization and Containerization

Objective:
The objective of this lab is to understand and apply virtualization and containerization
concepts.

td
Detailed Steps:

tl
Pv
1. Set Up a Virtual Machine Using KVM/QEMU:
● Install KVM (Kernel-based Virtual Machine) and QEMU (Quick Emulator) on your

ng
Linux system.

ni
sudo apt install qemu-kvm libvirt-clients libvirt-daemon-system bridge-utils
ar
virt-manager
Le

● Create a virtual machine using virt-install or virt-manager.


IE

sudo virt-install --name vm_name --memory 2048 --vcpus 2 --disk size=10 --cdrom
/path/to/iso --network bridge=br0 --graphics vnc,listen=0.0.0.0
AF

2. Install Docker and Pull a Docker Image:


N

● Install Docker on your Linux system.


AL

sudo apt install docker.io

● Pull a Docker image from the Docker Hub repository.


sudo docker pull ubuntu:latest

3. Run a Container from the Docker Image:


● Run a Docker container from the pulled Docker image.

td
sudo docker run -it ubuntu:latest /bin/bash

tl
● You are now inside the Docker container and can execute commands within the

Pv
container environment.

4. Introduction to Dockerfile and Docker Compose:

ng
● Create a Dockerfile to define the configuration and dependencies for building a
Docker image.
ni
ar
# Dockerfile
Le

FROM ubuntu:latest
RUN apt-get update && apt-get install -y \
package1 \
IE

package2 \
...
CMD ["/bin/bash"]
AF

● Build a Docker image from the Dockerfile.


N

sudo docker build -t my_image_name .


AL

● Introduction to Docker Compose for managing multi-container Docker


applications using a YAML configuration file.

Conclusion:
This lab has provided hands-on experience in virtualization and containerization.
Participants have learned how to set up a virtual machine using KVM/QEMU, install
Docker, pull Docker images, run containers, and work with Dockerfiles and Docker
Compose for container management. These skills are essential for system
administrators, developers, and DevOps engineers to deploy and manage applications in
isolated and lightweight environments.

td
tl
Pv
ng
ni
ar
Le
IE
AF
N
AL

You might also like