3

So it is very common among the docker community to separate the data container from the database container that is using this data. The most reason I have heard is that if you need to update the database, you can still access the same data from the new database container. I am struggling to understand why this is better than just mounting a volume from the disk to the database container, and if you update the container, mount the same volume into the new database container. These processes are basically the same thing. Is there any use case that I can't see?

http://www.offermann.us/2013/12/tiny-docker-pieces-loosely-joined.html

This link tries to explain the benefit but still, the same thing can happen with mounting volumes.

4

1 回答 1

1

即使在删除数据库容器之后,您也可以--link进入(或attach进入)数据容器。这将(可链接)数据容器的生命周期与数据库容器的生命周期分离。

于 2014-09-18T09:05:55.223 回答