Easier to read with cream paper, a tint, more contrast or larger text? Choose your colours and text, once, for every page.

Preview

DI 2.8: Containers: gains and limits

This is the first page of the lesson. Read it and have a go at the activities. The rest is in the full lesson.

60 minutes

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

WordWhat it means
Containera packaged app, with what it needs, that runs apart from other apps on a shared host
Imagethe saved package a container starts from
Kernelthe core of an operating system, which controls the hardware
Hostthe real machine that runs the containers
Portabilitybeing able to move something to another place and run it
Configureto set up a system the way you need it
Memory limita cap on how much memory a container may use
Virtual machinea computer made of software that runs inside a real one
Operating systemthe main software that runs a computer, such as Linux
Networkcomputers 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 questions
Have a go: your answers are marked here and then forgotten. Sign in if you would like your score kept, and to pick up where you left off.Sign in to keep your score

Your 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

Command
docker ps -a

A 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.

The lesson goes on

13 more parts of this lesson are in the full curriculum, with the tasks, the final check and the labs. A college account gives your students all of it.