Docker official Image packaging for Browserstack Local Binary
binary_version
/ platform
, choose the appropriate Dockerfile docker build -t <build name:tag> <path to dockerfile>
docker build -t local 8.9/ubuntu
docker run -it <build name:tag> --key <browserstack local testing access key>
docker run -it -p 127.0.0.1:45691:45691 -p 127.0.0.1:45690:45690 -p 127.0.0.1:45454:45454 -p 127.0.0.1:45954:45954 <build name:tag> --key <access key>
In order to run binary with custom arguments simply run the binary as follows.
docker run -it <build name:tag> <arguments>
Eg. Running binary inside container with force local and verbose 3 enabled
docker run -it browserstack/local --key <access key> --verbose 3 --force-local
Since the binary is running inside the docker container, it would try to resolve all the host requests internally. Following methods can be used in order to overcome this limitation.
Run the docker container with the following flag –net=host
. By setting this flag the container’s network stack is not isolated from the Docker host. ( For additional information refer here).
Running container with host netwroking
docker run --net=host -it browserstack/local <arguments>
host.docker.internal
. (For additional information refer here ( mac | windows ).Run the server on a public interface (eg. 0.0.0.0 ) and use the public address in your test scripts. (Disclaimer : Please do understand the risk of running a service on public interface before following this method ).
Can I run live and app-live using the binary running inside the container?
docker run -it -p 127.0.0.1:45691:45691 -p 127.0.0.1:45690:45690 <build name:tag> --key <access key>
Can I access binary console dashboard from my host?
docker run -it -p 127.0.0.1:45454:45454 -p 127.0.0.1:45954:45954 <build name:tag> --key <access key>