Lesson 1 · Unit 01
Container or VM
A process with its own view, sharing the host kernel
What you practise
- A container shares the host's kernel, isolated by namespaces and limited by cgroups
- Image against container
- Why it starts in milliseconds
Try a question from this lesson
Pick one
An app runs on your laptop but crashes on the server: the server has an older Python and lacks one library. What would have prevented it?
Correct answer
Shipping the app together with its runtime and libraries
Why
The code was the same; what surrounded it was not. A container image packs the app with its runtime, libraries and system files, so the server runs the same files your laptop did.
The ideas
Concept cards are short on purpose. In the app they appear between questions, after you have met the idea.
Concept
A process with its own view
A container is an ordinary process on the host. The kernel shows it a private view: its own files (from an image), its own process list, its own network and hostname.
Nothing is emulated. There is one kernel, the host's, and every container shares it.
host kernel (one, shared)
|- container A: app + its files
|- container B: app + its files
'- your shellConcept
Namespaces and cgroups
Two kernel features make a container.
Namespaces decide what the process can see: its own process IDs, network interfaces, mounted files and hostname.
Control groups (cgroups) decide how much it may use: a ceiling on memory, a share of CPU.
A container is a process started inside fresh namespaces with a cgroup around it. No hypervisor is involved.
9 more exercises in the app
- 3× multiple choice
- 1× true or false
- 1× match the pairs
- 2× type the answer
- 1× fill the blanks
- 1× order the lines
Bitpath is an iOS app in development. Join the waitlist and you get one email when it is ready to try.