Build it once, copy it forty times
A technician spends a whole day building one perfect PC. Every program is in. Every setting is right.
Then she saves that PC as one file and puts the file on forty more PCs before lunch. That file is a disk image.
Key words
| Word | What it means |
|---|---|
| Disk image | a single file that holds a copy of a whole system |
| Base image | the first image, built once and used as the starting point |
| Answer file | a file that holds the settings for each PC, such as its name |
| Distribution | sending the image to where it is needed |
| Automation | getting a computer to do a repeated task |
| Driver | a small program that lets the system use a piece of hardware |
| Consistency | every PC being built the same way |
| Vulnerability | a weakness that an attacker could use |
| Instability | a tendency to crash or behave oddly |
| Restoration | putting a system back to a known good state |
The cells students fill in are left blank in this preview.
By the end of this lesson
Note
I can list the steps of creating and deploying an image, and explain why images are worth using.
Starter
Have a go
Starter
3 questionsYour answers are marked here and are not kept. A college account keeps every student’s marks.
Six steps of an image job
- Create the base image file from a PC built and tested by hand.
- Create a customisation or answer file, for the things that differ per PC, such as its name.
- Add extra drivers and software that the image needs.
- Distribute the image to the servers or media that will use it.
- Deploy the image to the PCs.
- Update software versions and drivers in the image.
Why step six matters
An image does not update itself. A year-old image holds year-old software. Put that on a new PC and you start with known vulnerabilities and bugs that cause instability.
So update the versions and drivers in the image on a plan. Then every new PC starts safe.
What the lab can show
No lab here images a whole PC. The closest thing that runs is a Docker image. It is a saved, versioned starting point. It makes the same result every time, and a setting can be handed in at run time, like an answer file.
It is not a disk image of a PC. But the ideas are the same.
Build version 1 of a base image
printf 'FROM alpine:3.20\nRUN echo "build 1.0" > /build.txt\n' > Dockerfile && docker build -q -t pc-base:1 .A command for the lesson’s lab terminal. It is shown here and not run.
Make PC A from the image
docker run --rm pc-base:1 cat /build.txtA command for the lesson’s lab terminal. It is shown here and not run.