Most appropriate container for a data only container?

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.

Leave a Comment