我想先在Docker本地设置Kabana和Elastic Search,以显示本地不在Docker容器中的Python web应用程序的日志。不过,在服务器上,Python应用程序位于docker容器中。你知道吗
Kabana和Elastic Search还没有在服务器和本地设置。你知道吗
有没有可能把卡巴纳和卡巴纳放在不同的码头集装箱里,还是应该放在一个集装箱里?更新:推荐哪个选项?
如果只有一个,没有docker图像,Kabana和Elastic Search都存在,我该怎么办?
他们能从我的pythonweb应用程序本地检索日志吗?它不在docker容器中,还是我必须把Python应用程序也放入容器中?如果是后者,它可以是单独的容器还是我应该把它放在与Kibana和elasticsearch相同的容器中?
我会尽力回答你的问题:
为了更好地管理所有设置,我建议您查看Docker Compose。你知道吗
下面的示例说明了如何将两个容器链接起来:
简单的回答是:是的,你是自己的温顺,是的。你知道吗
Docker容器可以通过共享卷和网桥进行通信。 https://docs.docker.com/engine/userguide/containers/dockervolumes/https://docs.docker.com/engine/userguide/containers/networkingcontainers/
至于您的本地python应用程序,它取决于实现。如果要写入本地文件,那么卷是最好的方法。卷是映射到容器内路径的本地主机目录。你知道吗
如果您是通过网络协议进行的,那么您需要公开容器的端口,以便您的python应用程序可以访问它。你知道吗
现在,关于你的问题,有可能使你自己的形象。这是相当容易做到的。我将首先创建一个名为“Dockerfile”的文件,其中包含一个类似Ubuntu的基本图像
然后我会添加install命令来安装所需的软件包
实际上,您希望在
Dockerfile
中创建配置新安装的步骤 https://docs.docker.com/engine/userguide/containers/dockerimages/相关问题 更多 >
编程相关推荐