Main difference between Docker and VM
- Size
- VM : large size
To execute program, VM needs to have GuestOS which is very large size
- Docker : small size
Docker needs only bin/lib files which is compact size
- VM : large size
- Speed
- VM : slow
For example, when I/O occurs, VM needs to transfer the I/O from the GuestOS into HostOS, and transform to HostOS I/O driver
- Docker : fast
Docker container share its kernel with host OS, so doesn’t need to transform it
- VM : slow
- lifecycle(Portability)
- VM : complicate
for example, just in case you want to upgrade the version of your program. With VM, you need to pull from registry, update all configuration files, reset environments, etc. So it is very hard to change or update your program
- Docker : easy
Docker can simplify this process. Download image, run it!
- VM : complicate
Thus, with Docker, you can easily scale out your app. And this is a basic skill that lead you to make your service with Micro Architecture Service!