简体   繁体   中英

How to access Docker Selenium hub console in browser?

I am running docker selenium hub on windows. The container is up as docker log shows. However I am confused at what is the actual hostname that the hub uses. When i use conventional Selenium hub, I can use http://localhost:4444/grid/console to check that it's running correctly. But in this case of docker, I am confused at the printing of Docker log.

I tried 0.0.0.0, localhost, 172.17.0.2 as hostname to open /grid/console in browser. None of them works.

Also when I tried to use 'netstat -a' to list all tcp connections, I do not see any of them has port 4444.

在此处输入图片说明

在此处输入图片说明

Could anyone let me know what went wrong?

You are running docker on windows, there are two things you can do.

  1. Map your port 4444 to host when starting the container.
  2. On windows, your container is ruining in Boot2Docker virtual machine.
    So instead of http://localhost:4444/grid/console use http://{ip of boot2docker vm}:4444/grid/console

To get IP on boot2docker machine try the following command:

docker-machine ip default

Port expose docker example:

docker run -d -p 4444:4444 --name <container-name> <image-name> 

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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