简体   繁体   English

如何在多个Docker容器上运行的单个端口(8888)上访问Jupyter Notebook?

[英]How can I access Jupyter Notebook on single port (8888) running on multiple docker containers ?

I'm running Web application outside of the container and installation of Jupyter Notebook is done in a docker container. 我正在容器外部运行Web应用程序,而Jupyter Notebook的安装是在docker容器中完成的。 Now I would like to access Jupyter Notebook on the web page, running in multiple Docker containers. 现在,我想访问在多个Docker容器中运行的网页上的Jupyter Notebook。

This use case calls for having a way to route to a specific container based on URL path. 这种用例要求有一种基于URL路径路由到特定容器的方法。 So, you can use something like traefik to act as a gateway to your many docker containers. 因此,您可以使用traefik东西充当许多traefik容器的网关。

Each of your jupyter container should have a different Path: label and that would let traefik route traffic to the correct container when making requests like http://hostname/jupyter1 for example. 您的每个jupyter容器都应具有不同的Path:标签,例如,当发出诸如http://hostname/jupyter1类的请求时,traefik可以使traefik将流量路由到正确的容器。

Check the traefik matcher docs for more information on the labels required. 查看traefik匹配器文档 ,以获取有关所需标签的更多信息。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM