DOCKER - 4 1 Sommaire Images
Before jumping into images, let's look at what this section will cover. We'll start with the basics of images and the core concepts you'll need — what is actually inside an image, and just as importantly, what is not. We'll then explore how to find good images online, dig through some examples, and learn how to manage the images we download or build on our machines. Finally we'll create our own.
What an image really contains
An image is the application's binaries, its dependencies, and the metadata describing how to run it. The official definition phrases it as "an ordered collection of root filesystem changes and corresponding execution parameters intended for use within a container runtime". The crucial point: an image does not contain a full operating system. There's no kernel, no kernel modules like drivers. Your application doesn't need them because the kernel is provided by the host. This is one of the defining differences between containers and virtual machines — you're not booting a complete OS, you're booting an application.
Because of that, image sizes can vary enormously:
- An image can be a single static binary — for instance a Go application compiled into one file
- It can also be multiple gigabytes if you base it on a distribution like Ubuntu and install Apache, PHP, source code and extra modules
- The image is just the layers between "bare application" and "full distro" that your app actually needs
The next lessons will dive into how to find images, how to manage them locally, and how to build your own — starting from this foundation that an image is fundamentally just files and metadata, not a virtual machine.