Communicate from service BACK to job container #25562
-
Hello, I’m trying to build some selenium tests that use a docker image to host chromedriver (specifically the selenium/standalone-chrome image). This uses port 4444 by default. My job itself runs in a container and runs a simple web server on port 5000 as well as then running the selenium script. So the network comms looks like this:
Which isn’t working as I don’t know what IP or hostname to use in the selenium command. Normally I’d use host networking mode in docker and just use localhost. Is there a way to get the IP or a hostname of the job container so that the service can communicate back? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Resurrecting this because I had exactly the same problem (and with chromedriver too). Figure it will be handy to put in a solution I found that this works to give the container a name (in this example, the hostname becomes “mainservice”). You can then acess it using Docker networking.
Do note that the Docker DNS resolution is case senstive (bonkers, I know!) so be careful with your name. |
Beta Was this translation helpful? Give feedback.
Resurrecting this because I had exactly the same problem (and with chromedriver too). Figure it will be handy to put in a solution
I found that this works to give the container a name (in this example, the hostname becomes “mainservice”). You can then acess it using Docker networking.
Do note that the Docker DNS resolution is case senstive (bonkers, I know!) so be careful with your name.