How to deal with persistent storage (e.g. databases) in Docker

前端 未结 14 1086
野的像风
野的像风 2020-11-22 11:54

How do people deal with persistent storage for your Docker containers?

I am currently using this approach: build the image, e.g. for PostgreSQL, and then start the c

14条回答
  •  情歌与酒
    2020-11-22 12:07

    Use Persistent Volume Claim (PVC) from Kubernetes, which is a Docker container management and scheduling tool:

    Persistent Volumes

    The advantages of using Kubernetes for this purpose are that:

    • You can use any storage like NFS or other storage and even when the node is down, the storage need not be.
    • Moreover the data in such volumes can be configured to be retained even after the container itself is destroyed - so that it can be reclaimed, if necessary, by another container.

提交回复
热议问题