The ability to run in net=host mode
In the current implementation, the driver port inside the container is hardcoded. Therefore, it is not possible to run the container on the network host
I think this behavior can be fixed by adding an environment variable (--port=$SELENOID_PORT) in the entrypoint.sh file
@guskovd: in Docker you can map any port in container to any port in operating system. So in the case of Selenoid images you just forward 4444 to any port you wish. What is the use case for this? What issue are you trying to fix with --net=host?
Unfortunately, the networks in our openstack are arranged so that there is no way to run the containers in bridged mode It seems to me that the mode net=host is implemented for such cases.
In that case I would use going to binaries instead of Docker. You may want to contact us in our Telegram support chat: https://t.me/joinchat/AAAAAAkZ1DfzAv-eYWTlTQ
Why not just make the default port 4444 with the ability to change through the environment variable? in Dockerfile:
...
ENV SELENOID_NODE_PORT 4444
...
in entrypoint.sh:
#!/bin/bash
SCREEN_RESOLUTION=${SCREEN_RESOLUTION:-"1920x1080x24"}
/usr/bin/xvfb-run -a -s "-screen 0 $SCREEN_RESOLUTION -noreset" /usr/bin/chromedriver --port=$SELENOID_NODE_PORT --whitelisted-ips='' --verbose
Alternatively, you can add an optional entrypoint.sh script argument: --port=<alt_port>
Then docker users in net=host mode will be able to run the container through the docker binary:
"image": ["docker", "run", "--net=host", .... ]
We will remove -listen option from docker ENTRYPOINT in further release, it will allow to override port with command line option.