Skip to content
This repository has been archived by the owner on Dec 17, 2024. It is now read-only.

How to access host port from selenoid docker browser container #201

Closed
valburyakov opened this issue Aug 29, 2017 · 9 comments
Closed

How to access host port from selenoid docker browser container #201

valburyakov opened this issue Aug 29, 2017 · 9 comments
Milestone

Comments

@valburyakov
Copy link

Hello, i wonder if there is a possibility how to map a host port to docker container in order to access application which runs locally on my host ? I didn't found any options how i can set --add-host option in selenoid browser docker images. Thanks in advance

@aandryashin
Copy link
Member

Try to use host's eth0 (linux) or en0 (mac) ip address instead of 127.0.0.1 or localhost within container.

@valburyakov
Copy link
Author

valburyakov commented Aug 29, 2017

I tried to use host's ip address, create alias ifconfig lo0 alias 123.123.123.123/24 and even special Mac-only DNS name docker.for.mac.localhost but couldn't get host inside container.
As described here we need somehow to set extra_hosts for container.

@aandryashin
Copy link
Member

aandryashin commented Aug 30, 2017 via email

@valburyakov
Copy link
Author

valburyakov commented Aug 30, 2017

Thx, it works and but the problem is that for auth purpose (which uses external API) i should use dns-name instead of certain IP, dev.my-company.com. So is that possible to add host for selenoid docker containers with browsers ? like -add-host=dev.my-company.com:${MY_IP}

@vania-pooh
Copy link
Member

@valburyakov currently this is not supported. And according to moby/moby#23177 you can't specify this mapping in Docker daemon settings. Let us think a bit whether we could implement this.

@vania-pooh vania-pooh added this to the 1.3.6 milestone Sep 3, 2017
aandryashin added a commit that referenced this issue Sep 3, 2017
Ability to specify custom hosts entries per browser image (fixes #201)
@vania-pooh
Copy link
Member

@valburyakov you can try this by using aerokube/selenoid:latest and specify "hosts": ["example.com:192.168.0.1"] in config.json.

@vania-pooh
Copy link
Member

This works. Closing.

@valburyakov
Copy link
Author

@vania-pooh Thx a lot for this feature. This is exactly what I needed. I appreciate it.

@vania-pooh
Copy link
Member

@valburyakov this was released in Selenoid 1.3.6. So you can now use aerokube/selenoid:1.3.6.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants