Most appropriate container for a data only container?

前端 未结 4 532
攒了一身酷
攒了一身酷 2021-02-05 02:33

What is the most appropriate (smallest, simplest) container to use for a data only Docker container?

In the documentation they use the training/postgres container. Howe

4条回答
  •  死守一世寂寞
    2021-02-05 03:20

    Update: Now that we have named volumes, you generally don't want to use data containers at all.

    Use the same image for the data container - in this case the Postgres image. You don't leave data containers running, so it won't consume resources.

    Using the same image is important for several reasons:

    • It will take up less space as you already have the image cached.
    • The image gets a chance to seed the volume with data e.g. default files.
    • The permissions and owner will be correct.

    For more information see Data Only Container Madness.

提交回复
热议问题