Docker, Django and Selenium - Selenium unable to connect

前端 未结 3 2100
太阳男子
太阳男子 2020-12-18 12:28

I have Docker configured to run Postgres and Django using docker-compose.yml and it is working fine.

The trouble I am having is with Selenium not being able to conne

3条回答
  •  清酒与你
    2020-12-18 13:03

    Whenever you see localhost, try first to port-forward that port (at the VM level)

    See "Connect to a Service running inside a docker container from outside"

    VBoxManage controlvm "default" natpf1 "tcp-port8081,tcp,,8081,,8081"
    VBoxManage controlvm "default" natpf1 "udp-port8081,udp,,8081,,8081"
    

    (Replace default with the name of your docker-machine: see docker-machine ls)

    This differs for port mapping at the docker host level (which is your boot2docker-based Linux host)

    The OP luke-aus confirms in the comments:

    entering the IP address for the network solved the problem!

提交回复
热议问题