PhantomJS packed inside a container for webdriver tests
6.4K
This is a Docker Image with PhantomJS headless browser installed. PhantomJsEnv was created to run Selenium tests on PhantomJs without installing NodeJS and PhantomJS. PhantomJS is executed inside a container in ghostrdirver mode and connected from a host machine.
Grab prepacked image from a Docker Hub
docker pull davert/phantomjs-env
Or build image by yourself. Just clone this repo and run
docker build -t phantomjs-env .
PhantomJsEnv is able to connect to local or remote web sites.
Run the container and bind it to default Webdriver port 4444
docker run -i -t -p 4444:4444 davert/phantomjs-env
In case you want to access local website from container you can do the following:
if application is run on localhost (0.0.0.0) on a specific port, you can pass APP_PORT environment variable into it:
php -S 0.0.0.0:8000 &
docker run -i -t -p 4444:4444 -e APP_PORT=8000 davert/phantomjs-env
In case local web site is served by nginx or Apache, and is configured for a specific host, you can pass host name as environment variable:
docker run -i -t -p 4444:4444 -e APP_HOST=myapp davert/phantomjs-env
Content type
Image
Digest
sha256:cd95d4b85…
Size
202.1 MB
Last updated
almost 11 years ago
docker pull davert/phantomjs-env