Docker crash course
A Docker image is the “package” from our metaphor – it’s a static artifact that is saved, stored, and moved around. It becomes a container when it’s executed on a machine. This is important because you’ll sometimes hear these terms used incorrectly: Docker images are the immutable base from which a container – a running, namespaced process – is launched. Images are the pre-built template from which live containers are generated at runtime.
Images are designed to be immutable: if you download an nginx web server image and run it, any changes you make to the resulting container don’t affect the underlying image at all. This is the part that trips up most developers who are used to long-running virtual machines that are provisioned once and then started and stopped many times, preserving their internal state the whole time.
Docker containers are different. Ideally, they are designed to be ephemeral...