Docker images and containers
An image is a stateless building block in the Docker world. You can imagine an image as a collection of all files necessary to run your application together with the recipe on how to run it. The image is stateless, so you can send it over the network, store it in the registry, name it, version it, and save it as a file. Images are layered, which means that you can build an image on top of another image.
A container is a running instance of an image. We can create many containers from the same image if we want to have many instances of the same application. Since containers are stateful, we can interact with them and make changes to their states.
Let's look at the example of a container and the image layers structure: ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access