6

有没有办法设置 Rails 服务器,以便您可以连接远程 byebug 服务器并轻松调试?我过去通过设置 byebug 然后在 0.0.0.0 上启用 Rails 绑定并设置 VIRTUAL_PORT=3000 来完成此操作,但我想知道是否还有其他更简单的方法来调试已经运行的容器。我查看了https://docs.docker.com/engine/reference/commandline/attach/但无法正确设置它。

4

1 回答 1

4

See this previous answer. Do note that running your services in detached mode isn't necessary. Also when attaching to the rails container, it'll appear as if nothing happened in your terminal until you make a request to the rails application.

于 2017-05-19T17:12:50.393 回答