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

Preview

Containers and schedulers

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

55 minutes

It works on my machine

A developer says: "It works on my machine!" The tester says: "It does not work on mine."

The two computers are not the same. One has an old version of a tool. One has a missing file.

What if the program travelled with everything it needs, in one sealed box? This is the idea of a container.

Key words

WordWhat it meansExample
ContainerA program running in its own sealed box with everything it needs.
RAMThe fast memory a computer uses while a program runs.A phone with 8 GB of RAM
Virtual machineA whole pretend computer, running inside a real one.
Operating systemThe main software of a computer, such as Windows or Linux.
ImageA saved package with a program and its files. You make many containers from one image.
ContainerisationPacking software into containers so it runs the same everywhere.
RegistryAn online store of images that you can download from.
OrchestrationSoftware that starts, stops, moves and watches many containers for you.
KubernetesA popular platform that looks after containers. Its code is public.
ReplicaOne of several identical copies of a container.
ScalingRunning more copies when there is more work, and fewer when there is less.
Health checkA small test that shows a container is still working.

The cells students fill in are left blank in this preview.

What is a container?

A container holds a program and the files it needs. It runs apart from other containers.

You build a container from an image. One image can make 1 container or 100. They are all the same.

The best known tool is Docker. A file called a Dockerfile is the recipe that builds an image. It is a list of steps.

Quick check: containers

Have a go

Quick check: containers

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 Dockerfile, line by line

A line in the recipeWhat it tells Docker
FROM python:3.12Start from an image that already has Python
COPY . /appCopy my files into the folder /app inside the image
RUN pip install flaskInstall a library my program needs
CMD ["python", "/app/main.py"]When a container starts, run this command

The cells students fill in are left blank in this preview.

Container or virtual machine?

ContainerVirtual machine
What it isOne program in a sealed boxA whole pretend computer with its own operating system
Size (MB and GB are units of file size. 1 GB is 1000 MB)Small: often a few hundred MBLarge: often many GB
Start timeSecondsMinutes
Good forMany small servicesRunning a different operating system

The cells students fill in are left blank in this preview.

Container or virtual machine?

Have a go

Container or virtual machine?

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.

The lesson goes on

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