Day 1 Task: Build a Basic Isolated Shell
Goal:
Start a real shell process isolated into its own namespaces,
limited by a cgroup that restricts CPU usage.
Step 1 — Create a new isolated shell
On your lab machine:
You are now inside an isolated shell! 🎯
Check isolation:
-
Set a different hostname:
-
Check
ps aux
→ only processes inside your namespace. -
ip a
→ your network is empty (no IP assigned).
Step 2 — Create a CPU-limiting cgroup
Still inside your host shell (outside the unshared one):
What this does:
-
Creates a cgroup called mytestcgroup.
-
Limits CPU usage to 5% of 1 core (50000 microseconds quota per 100000 microseconds period).
-
Moves your shell process into that CPU-restricted cgroup.
Step 3 — Stress test CPU usage
Inside the isolated shell, launch a CPU burner:
Open another terminal, run:
Look at CPU usage —
it should stay very low, even though you are maxing out the process.
✅ If you see that CPU is limited → you nailed basic container tech manually.
Extra (optional)
-
Try creating a network namespace with a private IP.
-
Mount a minimal filesystem.
-
Launch a small daemon (like
nginx
orsshd
) inside.
But don’t overcomplicate Day 1 — focus on feeling the isolation and the resource limits.
Summary after this exercise:
-
You created real Linux isolation (namespaces + cgroups).
-
Without Docker, without Kubernetes, just Linux and your own commands.
-
100% real-world knowledge, production-level foundation.