About Dashboard inside Docker

Hi, I met a problem when running a ray program in docker and checking the dashboard in the host.

  1. I run a docker with docker run -p 9999:9999 option.
  2. I use ray.init(dashboard_port=9999,dashboard_host='0.0.0.0') in the docker and the console prints INFO services.py:1270 -- View the Ray dashboard at http://172.17.0.2:9999, which is expected.
  3. In the docker I check the dashboard is working:
root@03dc0ca63666:/home/game# lsof -i:9999
COMMAND PID USER   FD   TYPE    DEVICE SIZE/OFF NODE NAME
python3 192 root   27u  IPv4 165722973      0t0  TCP *:9999 (LISTEN) 
  1. Now I want to check the dashboard in the host. If all works right, I could open localhost:9999 in the host. However, it failed, and on host I check whether the port forwarding succeed. lsof -i:9999 gives empty output.
    Besides, I use docker ps to confirm that:
$docker ps
fd54703aabb2   test "bash"    About a minute ago   Up About a minute    0.0.0.0:8265->8265/tcp, :::8265->8265/tcp 

I am using:

pip install ray[default] -i https://pypi.tuna.tsinghua.edu.cn/simple    #(ray==1.8.0)
pip install 'aiohttp<3.8' -i https://pypi.tuna.tsinghua.edu.cn/simple

to avoid other issues.

Does anyone know what might go wrong here? Or how do you guys check the dashboard when running ray in the docker? Any comments are welcomed!

Hi, guys. Please feel free free to leave any comments

Are you binding the host:container ports so that port 9999 is exposed to the host? What does your docker run command look like or your docker compose?

Hi Sir, thanks for the reply!
I run a docker with docker run -p 9999:9999 option. Also, docker ps in the host gives:

CONTAINER ID   IMAGE                   COMMAND   CREATED       STATUS       PORTS                                                                                                                          NAMES
a92c0414d070   hnb                     "bash"    4 days ago    Up 4 days    0.0.0.0:9999->9999/tcp, ::::9999->9999/tcp   hnb

I suppose that means I have successfully export the docker port to the corresponding host port. I wonder if I make something wrong!

oddly enough I’m seeing something similar, even on the default port 8265 and if I try to access the ray dashboard, I get an ERR_CONNECTION_RESET in both docker and without docker

That sounds not good. Hope guys from the Ray team could give some suggestions.