https://github.com/prantlf/docker-geckodriver-headless
Docker image: Firefox and GeckoDriver for headless tests on Alpine Linux
https://github.com/prantlf/docker-geckodriver-headless
alpine docker docker-image firefox geckodriver
Last synced: about 2 months ago
JSON representation
Docker image: Firefox and GeckoDriver for headless tests on Alpine Linux
- Host: GitHub
- URL: https://github.com/prantlf/docker-geckodriver-headless
- Owner: prantlf
- License: mit
- Created: 2020-07-27T01:07:32.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2022-10-24T06:54:36.000Z (over 3 years ago)
- Last Synced: 2025-02-01T10:43:10.993Z (over 1 year ago)
- Topics: alpine, docker, docker-image, firefox, geckodriver
- Language: Makefile
- Homepage:
- Size: 12.7 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# prantlf/geckodriver-headless
[Docker] image: Firefox and GeckoDriver for headless tests on Alpine Linux
[This image] is supposed to help testing browser applications in [headless Firefox] driven by [`geckodriver`]. This image is built automatically on the top of the tag `latest` from the [Alpine repository], so that it is always based on the latest [Alpine Linux]. [Firefox] and `geckodriver` have to be updated from time to time by triggering a new build manually.
If you have trouble pulling the image from the Docker's default hub.docker.com, try gitlab.com, where [this project] is primarily maintained: `registry.gitlab.com/prantlf/docker-geckodriver-headless`.
## Tags
- [`latest`], `101`, `89`, `85`
## Install
docker pull prantlf/geckodriver-headless
## Use
Run the container in the foreground:
docker run --rm -it -p 4444:4444 geckodriver-headless
Run the container in the background before you start testing:
docker run --rm -d --name geckodriver -p 4444:4444 geckodriver-headless
Inspect the logging on the console:
docker logs geckodriver
Stop and remove the container after you stopped testing:
docker kill geckodriver
You can include this image in a `docker-compose.yml` for [docker-compose] too:
```yaml
version: 3.8
services:
geckodriver:
image: prantlf/geckodriver-headless
init: true
tmpfs: /tmp
ports:
- 127.0.0.1:4444:4444
```
GeckoDriver will start with the following parameters by default:
--host=0.0.0.0 --port=4444
All available command-line arguments for the `geckodriver` executable, which
you can append to the statement running the dockjer container:
--connect-existing Connect to an existing Firefox instance
--jsdebugger Attach browser toolbox debugger for Firefox
-v Log level verbosity (-v for debug and -vv for trace level)
-b, --binary Path to the Firefox binary
--log Set Gecko log level [possible values: fatal, error,
warn, info, config, debug, trace]
--marionette-host Host to use to connect to Gecko
[default: 127.0.0.1]
--marionette-port Port to use to connect to Gecko
[default: system-allocated port]
--host Host IP to use for WebDriver server [default: 127.0.0.1]
-p, --port Port to use for WebDriver server [default: 4444]
## Build, Test and Publish
The local image is built as `geckodriver-headless` and pushed to the docker hub with the tag `prantlf/geckodriver-headless:latest`.
# Remove an old local image:
make clean
# Build and tag new local images:
make build
# Enter an interactive shell inside the latest created image:
make shell
# Login to the docker hub:
make login
# Push the local image to the docker hub:
make push
## License
Copyright (c) 2019-2022 Ferdinand Prantl
Licensed under the MIT license.
[Docker]: https://www.docker.com/
[This image]: https://hub.docker.com/repository/docker/prantlf/geckodriver-headless
[this project]: https://gitlab.com/prantlf/docker-geckodriver-headless#prantlfgeckodriver-headless
[`latest`]: https://hub.docker.com/repository/docker/prantlf/geckodriver-headless/tags
[headless Firefox]: https://developer.mozilla.org/en-US/docs/Mozilla/Firefox/Headless_mode
[`geckodriver`]: https://github.com/mozilla/geckodriver#readme
[Firefox]: https://www.mozilla.org/firefox/
[Alpine Linux]: https://alpinelinux.org/
[docker-compose]: https://docs.docker.com/compose/