I am starting a Docker container with Chrome inside, as follows:
docker run --rm --cap-add=SYS_ADMIN --network=host selenoid/vnc:chrome_117.0
In my local machine, this container listens to incoming requests in the following URL: http://localhost:4444/
Nevertheless, I have a "connection refused" error when trying to connect that URL (http://localhost:4444/) after starting that image (using the host network) in GitHub Actions. The error I get in Java is the following:
Caused by: java.net.ConnectException: Connection refused (Connection refused)
Can I use the host network in GitHub Actions?
2
Answers
I confirmed this can be done in GH Actions. The problem I experienced was the use of Xvfb. For some reason, using Xvfb does not allow us to use port 4444 in the same session.
It is solved as follows:
Please have a look on this link How to access host port from docker containe and Can’t curl to localhost
Instead of localhost you can try http://host.docker.internal:4444/