CodePark/ questions / Images, containers & the runtime
START PRACTICINGPRACTICE
Backend question · Docker › Images, containers & the runtime

Which statement about images and containers is correct?

An image is a read-only template; a container is a running (or stopped) instance of it with its own writable layer

An image is a stack of read-only layers plus metadata, and it never changes. A container adds a thin writable layer on top and runs a process. So many containers can run from the same image at once, and each one keeps its own changes. This is why "Each image can only be used to run one container at a time" is wrong. "An image and a container are the same thing" is also wrong: a registry stores images, and pushing does not turn an image into a container.