What is the difference between a Docker image and a container ?
Answer
A Docker image is a read-only template containing the filesystem, dependencies and configuration needed to run an application, built once from a Dockerfile and then stored and versioned. A container is a running instance of that image, with a writable layer added on top for any changes made while it's running. You can launch several independent containers from the same image, each with its own runtime state, its own processes, and its own writable layer, without the original image ever being modified.
Common trap
The trap is believing changes made inside a running container, like manually installing a package, are kept if you launch a new container from the same image: they only persist in that specific container's writable layer, and disappear with it unless explicitly baked into a new image.