{"action":"created","issue":{"url":"https://api.github.com/repos/SeleniumHQ/docker-selenium/issues/92","repository_url":"https://api.github.com/repos/SeleniumHQ/docker-selenium","labels_url":"https://api.github.com/repos/SeleniumHQ/docker-selenium/issues/92/labels{/name}","comments_url":"https://api.github.com/repos/SeleniumHQ/docker-selenium/issues/92/comments","events_url":"https://api.github.com/repos/SeleniumHQ/docker-selenium/issues/92/events","html_url":"https://github.com/SeleniumHQ/docker-selenium/issues/92","id":102555207,"node_id":"MDU6SXNzdWUxMDI1NTUyMDc=","number":92,"title":"Selenium in container cannot connect to host in /etc/hosts","user":{"login":"pandeiro","id":361596,"node_id":"MDQ6VXNlcjM2MTU5Ng==","avatar_url":"https://avatars3.githubusercontent.com/u/361596?v=4","gravatar_id":"","url":"https://api.github.com/users/pandeiro","html_url":"https://github.com/pandeiro","followers_url":"https://api.github.com/users/pandeiro/followers","following_url":"https://api.github.com/users/pandeiro/following{/other_user}","gists_url":"https://api.github.com/users/pandeiro/gists{/gist_id}","starred_url":"https://api.github.com/users/pandeiro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pandeiro/subscriptions","organizations_url":"https://api.github.com/users/pandeiro/orgs","repos_url":"https://api.github.com/users/pandeiro/repos","events_url":"https://api.github.com/users/pandeiro/events{/privacy}","received_events_url":"https://api.github.com/users/pandeiro/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2015-08-22T17:54:31Z","updated_at":"2018-09-28T02:33:57Z","closed_at":"2015-08-22T23:14:01Z","author_association":"NONE","body":"I want a selenium container to be able to connect to an application running on the docker host. I am using a script like this to include that in `/etc/hosts`:\n\n```\n#!/bin/bash\n\nSED=\"$(which sed)\"\nNETSTAT=\"$(which netstat)\"\nGREP=\"$(which grep)\"\nAWK=\"$(which awk)\"\nCAT=\"$(which cat)\"\n\n\n$SED '/dockerhost$/d' /etc/hosts > /etc/hosts.tmp\nDOCKERHOST=\"$($NETSTAT -nr | $GREP '^0\\.0\\.0\\.0' | $AWK '{print $2}')\"\n\necho \"$DOCKERHOST dockerhost\" >> /etc/hosts.tmp\n\n$CAT /etc/hosts.tmp > /etc/hosts\n\nrm -rf /etc/hosts.tmp\n```\n\nThis script is `COPY`'d and run in building an image derived from `selenium/standalone-chrome-debug:latest`.\n\n**However when I try to connect to a URL such as \"http://dockerhost:8000/foo.html\", the selenium container's Chrome cannot access the URL.**\n\nIs this expected behavior? Why doesn't Chrome seem to resolve this host that is located `/etc/hosts`? Is there something I can do to be able to connect to such a host?\n"},"comment":{"url":"https://api.github.com/repos/SeleniumHQ/docker-selenium/issues/comments/425301677","html_url":"https://github.com/SeleniumHQ/docker-selenium/issues/92#issuecomment-425301677","issue_url":"https://api.github.com/repos/SeleniumHQ/docker-selenium/issues/92","id":425301677,"node_id":"MDEyOklzc3VlQ29tbWVudDQyNTMwMTY3Nw==","user":{"login":"chunji08","id":11307533,"node_id":"MDQ6VXNlcjExMzA3NTMz","avatar_url":"https://avatars0.githubusercontent.com/u/11307533?v=4","gravatar_id":"","url":"https://api.github.com/users/chunji08","html_url":"https://github.com/chunji08","followers_url":"https://api.github.com/users/chunji08/followers","following_url":"https://api.github.com/users/chunji08/following{/other_user}","gists_url":"https://api.github.com/users/chunji08/gists{/gist_id}","starred_url":"https://api.github.com/users/chunji08/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chunji08/subscriptions","organizations_url":"https://api.github.com/users/chunji08/orgs","repos_url":"https://api.github.com/users/chunji08/repos","events_url":"https://api.github.com/users/chunji08/events{/privacy}","received_events_url":"https://api.github.com/users/chunji08/received_events","type":"User","site_admin":false},"created_at":"2018-09-28T02:33:57Z","updated_at":"2018-09-28T02:33:57Z","author_association":"NONE","body":"Hi there, I had followed the same way and was able to add the extra rows in the /etc/hosts file, the question I have is, during the selenium execution time,  does it really reads the setting of the \"/etc/hosts\" file, within  this container ? "}}
{"actor":{"display_login":"chunji08"}}