最适合容器的数据只能容纳数据? [英] Most appropriate container for a data only container?

查看:112
本文介绍了最适合容器的数据只能容纳数据?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对不起,如果这是一个愚蠢的问题,但是最适合(最小,最简单)的容器用于仅数据的Docker容器?

Sorry if this is a silly question but what is the most appropriate (smallest, simplest) container to use for a data only Docker container?

在文档中使用培训/ postgres容器。但是,我相信另一个容器将实际运行数据库(例如postgres)。

In the documentation they use the training/postgres container. However, I believe another container will actually run the database (e.g. postgres).

http://docs.docker.com/userguide/dockervolumes/

我认为数据容器将非常小,因为它通常只在那里提供另一个容器的数据量。

I assume a data container would be very minimal since it is usually only there to provide the data volume for another container.

在创建仅数据的容器时,容器是否被忽略?

Perhaps the container is ignored when creating a data-only container?

谢谢,
Ashley。

Thanks, Ashley.

推荐答案

使用相同的图像作为数据容器 - 在这种情况下,Postgres图像。你不会让数据容器运行,所以它不会消​​耗资源。

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.

有关更多信息,请参阅< a href =http://container42.com/2014/11/18/data-only-container-madness/>仅限数据容器疯狂。

For more information see Data Only Container Madness.

这篇关于最适合容器的数据只能容纳数据?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆