Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Assignment 2 - I201822 - Rayed-Saeed #191

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions I20-1822-Rayed-Saeed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
Q1) Explain Docker Containers vs VMs

Ans 1) Containers: Containers provide OS level virtualization i.e. abstraction at
the app layer (code + dependencies). Containers share the host OS kernel and so many containers can be run on the same host eg. Alpine, CentOS containers can be run on ubuntu host OS. They take up less space (typically tens to hundreds of MBs in size) compared to VMs and are quick to start up.

VMs: VMs provide Hardware level virtualization i.e. abstraction of physical hardware. They share Hardware but have own OS. Each VM has a full copy of an operating system + application + binaries + libraries. They can take upto tens of GBs and hence are slower to boot up than containers.

Q2) Write command to create a docker container in detached mode with name assignment-2-<ROLL_NUMBER> running on host port 9090 and container port 80 using image nginx with version 1.24.0 on a custom network named assignment-2

Ans 2) docker run -d --name assignment-2-I20-1822 -p 9090:80 --network assignment-2 nginx:1.24.0

Q3) Run the above command and add screenshot of it and share the logs
Binary file added I20-1822_Ans3_Docker-Log.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.