多个 Docker 容器 ID 源自同一个 docker 镜像
正如我们在图中看到的那样,为什么来自同一命令路径的同一 Docker 映像有不同的容器 ID?
- 我需要来自同一映像的多个容器的具体情况是什么?
- 这些容器中的“每个”是否消耗相同大小的图像?
- 我注意到重新启动系统后会列出新的容器 ID。管理场景并使用相同容器 ID 运行的最佳方法是什么?
- docker commit 与 docker 中的持久卷含义相同吗?如果不是,它们有何不同?
Why there is different container Id originating from the same Docker Image from the same command path as we can see in the picture?
- What can be the specific case where I need several containers from the same images?
- Do 'each' of these containers consume the equivalent size of the image?
- I have noticed that the new container Id is listed once I reboot the system. What is the best approach to manage the scenario and run using the same container Id?
- Does docker commit mean same as persistent volumes in docker? If no, how do they differ?
I couldn't find answers on stackoverflow. If the question is redundant please remove.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
来区分不同的运行容器。
例如,您想要运行两个 sshd 服务 - 一个在端口 22 上,另一个在端口 23 上。或者任意两个相同的服务。
或者有两个开发人员使用一台机器,并且都同时在 docker 中编译他们的项目。
ETC。
基层共享磁盘空间。每个容器都有自己的私有文件系统,安装在其他层的“顶部”。他们只消耗他们所做的更改。他们分享他们建造的顶部的图像。您可能想研究一下 squashfs 和 https://docs.docker.com/storage/storagedriver/。
容器内的每个进程都有独立的进程空间。
使用名称。
不。
它创建一个新的 docker 层,并将其作为新的 docker 镜像提交。
Image = tar.gz 和文件。
容器 = 运行映像的一个实例。
To differentiate different running containers.
For example you want to run two sshd services - one on port 22 and other on port 23. Or any two same services.
Or there are two developers using one machine, and both are compiling their projects in a docker at the same time.
Etc.
The base layers share the disc space. Each container has its own private filesystem mounted "on top" other layers. They consume only the changes they made. They share the image on top they were built. You may want to research squashfs and https://docs.docker.com/storage/storagedriver/ .
Each processes inside containers have separate process space.
Use NAMES.
No.
It creates a new docker layer, and commits that as a new docker image.
Image = tar.gz with the files.
Container = one instance of running image.