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

前端 未结 14 1308
野的像风
野的像风 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:10

    In case it is not clear from update 5 of the selected answer, as of Docker 1.9, you can create volumes that can exist without being associated with a specific container, thus making the "data-only container" pattern obsolete.

    See Data-only containers obsolete with docker 1.9.0? #17798.

    I think the Docker maintainers realized the data-only container pattern was a bit of a design smell and decided to make volumes a separate entity that can exist without an associated container.

提交回复
热议问题