Ten apps, one small server
A firm wants to run ten small apps. With virtual computers made of software, it needs ten whole copies of a system. The server runs out of memory at app number six.
A technician starts the same ten apps as containers. They all fit, with room to spare, and each one starts in a second.
How is that possible, and what is the catch?
Key words
| Word | What it means |
|---|---|
| Container | a packaged app, with what it needs, that runs apart from other apps on a shared host |
| Image | the saved package a container starts from |
| Kernel | the core of an operating system, which controls the hardware |
| Host | the real machine that runs the containers |
| Portability | being able to move something to another place and run it |
| Configure | to set up a system the way you need it |
| Memory limit | a cap on how much memory a container may use |
| Virtual machine | a computer made of software that runs inside a real one |
| Operating system | the main software that runs a computer, such as Linux |
| Network | computers and devices joined together so they can share data |
The cells students fill in are left blank in this preview.
By the end of this lesson
Note
I can give four gains and three limits of containers and show what a container is with real commands.
Starter
Have a go
Starter
3 questionsYour answers are marked here and are not kept. A college account keeps every student’s marks.
A container shares the host's kernel
A virtual machine carries a whole operating system. A container carries only the app and the files it needs. It shares the kernel of the host.
You met containers briefly in the core lessons on virtual environments. This lesson looks at the gains and limits.
Sharing the kernel is the secret behind the gains, and behind the limits too.
Look at a real container stack
The lab has three containers: web, cache and worker. Press Start the lab, then press Run on each command.
The first command lists every container, including ones that have stopped.
List the containers
docker ps -aA command for the lesson’s lab terminal. It is shown here and not run.
How to read it
Note
Each row is one container, with its image and its status. web and cache say healthy. worker says Exited: it stopped because of a setting. Look at its log with docker logs worker.