# Docker v.s. VM
###### tags: `Other`
## Docker vs VM
* 
* Pros of containers
* image small (xMB) (only contain file sysmte, no contain os)
* 啟動速度快 (few seconds)
* 具有可攜性
* 執行需要的resource比VM小
* 
* Intro.
* Container是以應用程式為單位,而VM是以作業系統為單位 -> 建立Container不需要等待作業系統開機時間,不用1分鐘或幾秒鐘就可以啟用
* Container依賴Host OS的核心(kernel)來運行Container,因此Windows的Container必須在Windows OS上運行;Linux的Container必須在Linux-base OS上運行。而VM則可以隨意選擇。
## Different OS
* 正常usage下不行
* **由於容器與容器主機共用核心**
* Run a Windows image on a Linux host -> X
## How to manage resouce for each container
* For a container: can assign specific CPU / momory limit