使用JetBrains Gateway时,如何将端口从Gitpod-container转发到本地机器?
我使用GitPod和Jetbrains Gateway来开发我的应用程序。我在Gitpod-container内的Docker容器中运行一个应用程序。带有应用程序的容器曝光端口以处理HTTP请求。 是否可以使用JetBrains Gateway将此端口转发到我本地机器中的端口?
I use GitPod and JetBrains Gateway to develop my application. I run an application in a docker container inside GitPod-container. The container with application expose ports to handle HTTP requests.
Is it possible to forward this port to port in my local machine using JetBrains Gateway?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您是否考虑过以下方法?
假设一个docker容器曝光8080,在
.gitpod.yml
中,您将拥有类似的东西:.gitpod.yml
:将向您提供工作空间的远程URL,公开端口8080。URL看起来像:
https:///8080-xh.ws-eu444xl .gitpod.io
。仅供参考,如果您觉得这很有用,也可以选择通过SSH连接到工作区。您可以在工作区跑步态页面中的“更多操作”按钮中找到SSH连接片段,或者在探索活动工作空间列表时(单击三个点)。
如果有帮助,我创建了一个样本回购来测试以下测试: https://github.com /andreafalzetti/gitpod-示例c
如果您想端口并打开
http:// localhost:{port}
在本地,我认为这是Jetbrains Gateway当前不支持的。Did you consider the following approach?
Assuming a docker container exposing 8080, in
.gitpod.yml
you would have something like:.gitpod.yml
:You will be presented with the remote URL for the workspace, exposing the port 8080. The URL will look like:
https://8080-****.ws-eu44xl.gitpod.io
.FYI, there is also an option to Connect via SSH to the workspace, if you find that useful. You find the SSH connection snippet, in the "More Actions" button in the workspace running-status page or when you explore the list of active workspaces (click on the three dots).
If it helps, I've created a sample repo to test this: https://github.com/andreafalzetti/gitpod-experiments-c
If you want to port-forward and open
http://localhost:{PORT}
locally, I think that is currently not supported by JetBrains Gateway.