[英]What is the difference between a package and container?
GitHub recently released a container registry alongside their package registry. GitHub 最近与他们的 package 注册表一起发布了一个容器注册表。 What is the difference?
有什么不同? When would it be better to use one or the other?
什么时候使用一个或另一个更好? Do we need both?
我们都需要吗?
Packages are generally simple: they are essentially an archive (ie zip file) that contains contents (code libraries, application executables, etc.) and a manifest file (json document, xml file, etc) that describes those contents with a package name and version number (at a minimum).包通常很简单:它们本质上是一个存档(即 zip 文件),其中包含内容(代码库、应用程序可执行文件等)和一个清单文件(json 文档、xml 文件等),该清单文件用 package 名称和 package 描述这些内容版本号(至少)。 ie:- npm,pip and composer packages.
即:- npm,pip 和作曲家包。
Container images are also simple, but they're more like an archive (ie a zip file) than a package. ie:- nginx, redis etc容器镜像也很简单,但它们更像是一个存档(即 zip 文件)而不是 package。即:- nginx、redis 等
Verdict:- if some libs repetitively used in any project then we can create package and use in project.while for all project based dependencies we need to choose container to run this.判决:- 如果某些库在任何项目中重复使用,那么我们可以创建 package 并在项目中使用。而对于所有基于项目的依赖项,我们需要选择容器来运行它。 Yes we need both.
是的,我们两者都需要。
After debating this with a Docker-using friend for a while I think I've found a satisfactory explanation:在与一位使用 Docker 的朋友讨论了一段时间后,我想我找到了一个令人满意的解释:
This is a bit confused by the fact that a Package can contain a standalone Applications, and Containers will often use package managers like Apt to install these applications.这有点令人困惑,因为一个 Package 可以包含一个独立的应用程序,而容器通常会使用像 Apt 这样的 package 管理器来安装这些应用程序。 I feel like this is an abuse of package management due to a legacy where we didn't have Containers.
我觉得这是对 package 管理的滥用,因为我们没有容器。 Eventually I would expect most Applications will be delivered in Container form.
最终我希望大多数应用程序将以容器形式交付。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.