Machine Image vs Container Image
People think a machine image and a container image are the same kind of file, and they are not. A machine image is a whole saved disk, with its own system. A virtual machine starts from it. A container image holds just an app and its parts. It borrows the system of the machine that runs it. So a machine image is far bigger and slower to start.
Machine Image
A saved disk that new virtual machines start from, all set up the same.
A machine image is a saved disk that new virtual machines start from. It holds the operating system and any software already set up. Every machine started from it begins the same. Teams build one image with all they need. Then they start as many copies as they like. Cloud providers also offer ready-made images, such as plain Ubuntu.
Container Image
The saved pack that a container starts from. One image can start many of them.
A container image is the saved package a container starts from. It holds the app, its tools and its settings, stacked in layers. Each layer adds or changes some files. An image never changes once it is built. To change it, you build a new one with a new tag. One image can start many containers at the same time.
In one line
- Machine Image
- A saved disk that new virtual machines start from, all set up the same.
- Container Image
- The saved pack that a container starts from. One image can start many of them.