0% found this document useful (0 votes)
11 views14 pages

Overview of Operating Systems and Docker

The document provides an overview of different types of operating systems, including desktop, server, mobile, embedded, real-time, network, and distributed systems, along with examples for each. It also explains the distinction between Linux and Ubuntu, highlighting that Linux is a kernel while Ubuntu is a complete distribution built on it. Additionally, the document covers Docker, its architecture, commands, and a step-by-step guide for hosting a static website using Docker from WSL.

Uploaded by

mshree0327
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views14 pages

Overview of Operating Systems and Docker

The document provides an overview of different types of operating systems, including desktop, server, mobile, embedded, real-time, network, and distributed systems, along with examples for each. It also explains the distinction between Linux and Ubuntu, highlighting that Linux is a kernel while Ubuntu is a complete distribution built on it. Additionally, the document covers Docker, its architecture, commands, and a step-by-step guide for hosting a static website using Docker from WSL.

Uploaded by

mshree0327
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

💻 Different Operating Systems (OS)

An Operating System (OS) is system software that manages hardware and allows users to
run applications.

🔹 1️⃣ Desktop / Personal Operating Systems

Used on PCs and laptops.

Examples:

 Windows (Microsoft)
 macOS (Apple)
 Linux (Ubuntu, Fedora, Debian)

📌 Most common for daily use.

🔹 2️⃣ Server Operating Systems

Used on servers to run applications and websites.

Examples:

 Linux (Ubuntu Server, Red Hat, CentOS)


 Windows Server
 Unix

📌 Stable, secure, runs 24/7.

🔹 3️⃣ Mobile Operating Systems

Used on smartphones and tablets.

Examples:

 Android
 iOS

📌 Touch-based OS.

🔹 4️⃣ Embedded Operating Systems


Used in devices and appliances.

Examples:

 Embedded Linux
 FreeRTOS
 VxWorks

📌 Used in:

 Washing machines
 Cars
 Routers
 Medical devices

🔹 5️⃣ Real-Time Operating Systems (RTOS)

Used where time-critical responses are required.

Examples:

 RTOS
 QNX
 VxWorks

📌 Used in:

 Aircraft
 Robotics
 Industrial control systems

🔹 6️⃣ Network Operating Systems

Used to manage network resources.

Examples:

 Novell NetWare
 Windows Server
 Linux (Network services)

🔹 7️⃣ Distributed Operating Systems

Manages multiple computers as one system.


Examples:

 Amoeba
 Plan 9
 LOCUS

📊 Summary Table (Best for Exams)

OS Type Examples
Desktop OS Windows, macOS, Linux
Server OS Linux, Windows Server
Mobile OS Android, iOS
Embedded OS Embedded Linux, FreeRTOS
RTOS VxWorks, QNX
Network OS Windows Server, Linux
Distributed OS Plan 9, Amoeba

📝 One-Line Exam Answer

Operating systems include desktop, server, mobile, embedded, real-time, network, and
distributed operating systems.

“Different operating systems are designed for different purposes.”

🐧 Difference Between Linux and Ubuntu

🔹 1️⃣ What is Linux?

Linux is an operating system kernel.

 Kernel = core part of OS


 Manages:
o CPU
o Memory
o Devices
o Processes
Linux alone is NOT a complete OS.

🔹 2️⃣ What is Ubuntu?

Ubuntu is a Linux distribution (distro).

 Built on top of Linux kernel


 Includes:
o Linux kernel
o Package manager
o Desktop environment
o System tools
o User applications

Ubuntu is a complete operating system.

🧠 Simple Analogy (Very Important)

Concept Example
Linux Engine
Ubuntu Car

👉 Engine alone can’t be used directly


👉 Car (engine + body + controls) can be used

📊 Tabular Difference (Best for Exams)

Linux Ubuntu
Kernel Distribution
Core of OS Complete OS
No GUI by default Comes with GUI
Developed by Linus Torvalds Developed by Canonical
Needs tools to be usable Ready to use
Many distributions use it One of the distributions

🔹 Examples of Linux Distributions

 Ubuntu
 Red Hat
 CentOS
 Debian
 Fedora
 Kali Linux

All use Linux kernel.

🐳 DOCKER

1️⃣ What is Docker?

Docker is a containerization tool that allows us to package an application along with its
libraries and dependencies and run it anywhere.

👉 “Write once, run anywhere”

2️⃣ Why Docker is needed?

Before Docker:

 App works on developer system ❌


 Fails on server ❌
 Dependency issues ❌

With Docker:

 Same container runs everywhere ✅


 Lightweight (faster than VM) ✅
 Easy deployment ✅

3️⃣ Docker Architecture (Explain verbally)

User → Docker CLI → Docker Engine → Containers

 Docker CLI → commands (docker run)


 Docker Engine → runs containers
 Docker Image → template
 Docker Container → running instance
4️⃣ Important Docker Terms (Very Important for Exams)

Term Meaning
Image Blueprint of application
Container Running instance of image
Dockerfile Instructions to build image
Docker Hub Online image repository
Port Mapping Connect container port to host

5️⃣ Check Docker Installation

Command:

docker --version

Explanation:

 Checks if Docker is installed


 Shows Docker version

6️⃣ First Docker Command (Hello World)

Command:

docker run hello-world

What happens:

1. Docker checks local image


2. If not found → pulls from Docker Hub
3. Creates container
4. Runs it
5. Prints message
6. Stops container

✅ Confirms Docker is working

7️⃣ Pull an Image (Without Running)

Command:

docker pull nginx

Explanation:
 Downloads nginx image
 Does NOT start container

8️⃣ Run Nginx Container (IMPORTANT)

Command:

docker run -d -p 8081:80 --name nginx_server nginx

Explanation (line by line):

Part Meaning
docker run Create & start container
-d Run in background
-p 8081:80 Host port → Container port
--name nginx_server Container name
nginx Image name

Result:

 Nginx runs inside container


 Access via browser:

[Link]

9️⃣ Check Running Containers

Command:

docker ps

Explanation:

 Shows only running containers

🔟 Check All Containers

Command:

docker ps -a

Explanation:

 Shows running + stopped containers


1️⃣1️⃣ Stop a Container

Command:

docker stop nginx_server

Explanation:

 Gracefully stops container

1️⃣2️⃣ Start Existing Container

Command:

docker start nginx_server

1️⃣3️⃣ Remove Container

⚠ Must stop first

docker stop nginx_server


docker rm nginx_server

1️⃣4️⃣ Enter Inside Container (Very Important)

Command:

docker exec -it nginx_server bash

Explanation:

 exec → execute command


 -it → interactive terminal
 bash → shell inside container

Now you are inside Linux container 🐧

Exit:

exit

1️⃣5️⃣ View Container Logs


docker logs nginx_server

1️⃣6️⃣ Docker Container Lifecycle (Exam Favorite)

Pull → Create → Run → Stop → Remove

1️⃣7️⃣ Difference: VM vs Docker (Short Answer)

VM Docker
Heavy Lightweight
Full OS Shares OS
Slow startup Fast startup

1️⃣8️⃣ Real-world DevOps Use Case

 Jenkins builds application


 Docker packages app
 Container deployed to server
 Same container runs everywhere

🧪 In Docker / WSL Context (Important)

 WSL installs Ubuntu


 Docker containers run on Linux kernel
 Ubuntu is used because it is:
o Stable
o Beginner-friendly
o Well-supported

📝 One-Line Exam Answer

Linux is an open-source operating system kernel, while Ubuntu is a Linux-based distribution


that provides a complete operating system.

📝 Short Paragraph

Linux is the core kernel of an operating system responsible for hardware and process
management. Ubuntu is a Linux distribution that includes the Linux kernel along with system
tools, package managers, and a user interface, making it a complete and user-friendly
operating system.
“Linux is the core, Ubuntu is the complete system.”

✅ Step-by-step FIX (Clean & Correct)

🔹 Step 1: Remove the failed container

You must remove it before creating a new one.

docker rm 5933887afcec

Verify:

docker ps -a
➡️Should be empty

🔹 Step 2: Run nginx on a free port (8081)

docker run -d -p 8081:80 --name nginx_server nginx

✅ Expected output: container ID

🔹 Step 3: Check running container

docker ps

You should see:

[Link]:8081->80/tcp

🔹 Step 4: Open Browser

👉 Open:

[Link]

🎉 You will see:


Welcome to nginx!

Concept Summary (Very Important)

Command Meaning

docker ps Shows running containers only

docker ps -a Shows all containers

--------------------------------------------------------------------------------------------------------------

Host a static website using Docker from WSL (Ubuntu on Windows).

What we are doing

 Create a static website (HTML file)

 Use Nginx (web server) inside a Docker container


 Run everything from WSL

 Access the website from Windows browser

Step 1: Open WSL (Ubuntu)

From Windows:

 Open Start → Ubuntu (WSL)

Check Docker is working:

docker --version

If Docker works, you’re good to go ✅

Step 2: Create a project folder

mkdir static-site
cd static-site

Step 3: Create a simple HTML file

nano [Link]

Paste this:

<!DOCTYPE html>
<html>
<head>
<title>My Docker Website</title>
</head>
<body>
<h1>Hello from Docker + WSL 🎉</h1>
<p>This is a simple static website.</p>
</body>
</html>

Save:

 CTRL + O → Enter
 CTRL + X

Step 4: Create Dockerfile


nano Dockerfile

Paste this:

# Use nginx web server


FROM nginx:alpine

# Copy website files to nginx folder


COPY [Link] /usr/share/nginx/html/[Link]

Save and exit.

Step 5: Build Docker image

docker build -t my-static-site .

✅ This creates your custom Docker image

Step 6: Run the container

docker run -d -p 8080:80 --name static_container my-static-site

Meaning:

 -p 8080:80 → map container port 80 to your system port 8080


 -d → run in background

Step 7: Open in browser (Windows)

Open Chrome / Edge and go to:

👉 [Link]

🎉 You will see your static website!

Important Docker commands (quick revision)

docker ps # running containers


docker ps -a # all containers
docker stop static_container
docker start static_container
docker rm static_container
docker images

How data flows (behind the scenes)

Browser (Windows)

localhost:8080

Docker (WSL)

Nginx container

[Link]

You might also like