###### tags: `Study Circle Note`, `Docker in Action 2ed` # Docker in Action 2ed 第二次 2021-06-18 - Ch2 ## 討論 - 綁定 host 資料夾跟使用 volume 有什麼優缺點? - `-v` - volume: docker 儲存區,預設會有 volume directory,如果有指定 volume 會掛載於後面指定 directory path,因此 container 被消滅後他的資料還是會被保存。ex: database - https://github.com/wagoodman/dive - https://12factor.net/ - 作者於章節二大量描述要怎麼 dependencies 隔離,盡可能與環境解耦合。 - 為什麼要用 Exponential backoff - https://en.wikipedia.org/wiki/Exponential_backoff - tmpfs 沒有加的話是否有影響? - 後面所有的 tmp 其實可以不用加,代表 tmp file 寫入到的定 `/tmp` - 書中的範例是指因為 Apache2 會使用到 /tmp ,所以才說 `We will also supply a temporary, in-memory, filesystem to the container at /tmp since Apache requires a writable temporary directory` - [掛載方式的不同對資料儲存的影響](https://stackoverflow.com/questions/42816048/docker-temporary-files-strategy/55104489) - 想問個額外的,mount 跟 volume 差在哪? - `mount`: 動作 - `volume`: 名詞,儲存區 - 補充一下,第二章有提到 Container 的狀態有以下幾種 - Created - Running - Restarting - Paused - Removing - Exited