Connect to docker container in a remote server #550
-
Hi artisans! I'm trying to use Ray to debug a remote system, here's my setup Local developement machine note: I can use Ray without any issue to connect to a docker container running on my local dev machine and to a non-dockerized application running on my remote server. The issue, I think, only for remote+docker setup if I log in in my docker container and try to ping my host: fabio@docker: $ ping host.docker.internal PING host.docker.internal (172.17.0.1) 56(84) bytes of data. 64 bytes from host.docker.internal (172.17.0.1): icmp_seq=1 ttl=64 time=0.154 ms but can't connect to port 23517: fabio@docker: $ curl host.docker.internal:23517 curl: (7) Failed to connect to host.docker.internal port 23517: Connection refused outside the docker container (in my server shell), all works fine: fabio@server: $ curl host.docker.internal:23517 <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>Error</title> </head> <body> <pre>Cannot GET /</pre> </body> </html> some info from my server: fabio@server: $ netstat -tulpen | grep 23517 tcp 0 0 127.0.0.1:23517 0.0.0.0:* LISTEN 1000 76498171 1916935/sshd: docke tcp6 0 0 ::1:23517 :::* LISTEN 1000 76498170 1916935/sshd: docke fabio@server: $ ps -aux | grep 1916935 docker 1916935 0.0 0.0 12800 4408 ? S 07:00 0:00 sshd: docker docker 1917029 0.0 0.0 8160 2548 pts/2 S+ 07:02 0:00 grep --color=auto 1916935 I think there is one issue when ray tries to forward port 23517 through ssh tunnel. maybe it binds to localhost:23517 but can't manage to catch connection host.docker.internal:23517? can anyone with a stronger docker knowledge help? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
I found the issue: my sshd config was forcing to bind only internal connection (see 127.0.0.1:23517) I solved by enabling this setting in /etc/ssh/sshd_config:
@freekmurze maybe this should be added to Ray docs? In linux systems the default is set to |
Beta Was this translation helpful? Give feedback.
I found the issue:
my sshd config was forcing to bind only internal connection (see 127.0.0.1:23517)
I solved by enabling this setting in /etc/ssh/sshd_config:
GatewayPorts yes
@freekmurze maybe this should be added to Ray docs? In linux systems the default is set to
no