重新使用主机二进制文件或在Docker中的容器之间共享 [英] Reuse host binaries or share between containers in Docker

查看:397
本文介绍了重新使用主机二进制文件或在Docker中的容器之间共享的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

考虑以下情况:

有三个独立的Web应用程序A,B和C需要运行apache服务器。

There are three independent web applications A, B and C that require an apache server to be run on.

一个linux服务器运行Web应用程序A,可以充当Docker主机。要求应用程序B和C与linux服务器和彼此隔离。因此,它们实现为两个Docker容器,最初由相同的映像创建。

A linux server runs web application A and may act as a Docker host. It is required that the applications B and C are isolated from the linux server and each other. They are therefore realized as two Docker containers, initially created from the same image.

我的问题更新和特殊的安全更新。

My question updates, and security updates in special.

两个Docker容器是否需要完整的操作系统安装映像?他们可以共享主机的apache二进制文件,因此主机的apache的安全更新可以自动传播到容器?

Do the two Docker containers require a full OS installation image? Can they share the host's apache binary, so security updates of the host's apache could be propagated to the containers automatically?

如果这不行:我需要安装或者可以从这个事实中获益,它们是以相同的图像为基础的,以某种方式简化更新过程?

If this doesn't work: Would I need to install updates for apache on both containers independently, or could I benefit from the fact, that they are based on the same image, and somehow simplify the update process?

推荐答案

Docker将不会从主机服务器共享将丢失该点的二进制文件。什么码头工具有一个分层文件系统,这意味着共享一个基础的两个码头图像在共享相同的主机时要更加节省空间。

Docker will not share binaries from the host server that would be missing the point. What docker does have is a layered file system which means two docker images that share a common base will be more space efficient when sharing the same host.

关于修补。如果更新基本图像,则需要重建从其导出的容器图像。如果您正在使用注册表来存储和分发图像,那不是什么大不了的事情。更新您执行拉操作的主机服务器来更新本地映像,然后重新启动容器。

As for patching. If you update the base image, you'll need to rebuild the container images that derive from it. Not a big deal, if you're using a registry to store and distribute images. to update the host server you perform a "pull" operation to update the local images, followed by a container restart.

这篇关于重新使用主机二进制文件或在Docker中的容器之间共享的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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