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

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

    While this is still a part of Docker that needs some work, you should put the volume in the Dockerfile with the VOLUME instruction so you don't need to copy the volumes from another container.

    That will make your containers less inter-dependent and you don't have to worry about the deletion of one container affecting another.

提交回复
热议问题