{"id":13424582,"url":"https://github.com/joyzoursky/docker-python-chromedriver","last_synced_at":"2025-10-02T15:30:17.297Z","repository":{"id":39595080,"uuid":"68898255","full_name":"joyzoursky/docker-python-chromedriver","owner":"joyzoursky","description":"Dockerfile for running Python Selenium in headless Chrome (Python 2.7 / 3.6 / 3.7 / 3.8 / Alpine based Python / Chromedriver / Selenium / Xvfb included in different versions)","archived":true,"fork":false,"pushed_at":"2024-04-12T13:16:16.000Z","size":37,"stargazers_count":639,"open_issues_count":12,"forks_count":196,"subscribers_count":20,"default_branch":"master","last_synced_at":"2024-09-25T01:06:21.836Z","etag":null,"topics":["chromedriver","docker","dockerfile","headless-chrome","python","selenium","xvfb"],"latest_commit_sha":null,"homepage":"https://hub.docker.com/r/joyzoursky/python-chromedriver/","language":"Dockerfile","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/joyzoursky.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-09-22T07:57:15.000Z","updated_at":"2024-09-21T17:58:07.000Z","dependencies_parsed_at":"2024-04-12T14:52:54.180Z","dependency_job_id":null,"html_url":"https://github.com/joyzoursky/docker-python-chromedriver","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joyzoursky%2Fdocker-python-chromedriver","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joyzoursky%2Fdocker-python-chromedriver/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joyzoursky%2Fdocker-python-chromedriver/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joyzoursky%2Fdocker-python-chromedriver/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/joyzoursky","download_url":"https://codeload.github.com/joyzoursky/docker-python-chromedriver/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":219875712,"owners_count":16554705,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["chromedriver","docker","dockerfile","headless-chrome","python","selenium","xvfb"],"created_at":"2024-07-31T00:00:56.627Z","updated_at":"2025-10-02T15:30:16.880Z","avatar_url":"https://github.com/joyzoursky.png","language":"Dockerfile","readme":"# docker-python-chromedriver (Deprecated)\n\nPython with Chromedriver, for running automated tests\n\n## Quick Try\n\n```\n$ git clone https://github.com/joyzoursky/docker-python-chromedriver.git\n$ cd docker-python-chromedriver\n$ docker run -it -w /usr/workspace -v $(pwd):/usr/workspace joyzoursky/python-chromedriver:latest bash\n/usr/workspace# pip install selenium\n/usr/workspace# python test_script.py\n```\n\n\u003e Warning: Current versions only support for building and running on amd64 (aka x86-64) machines, for arm64 (e.g. Apple M1 chip) machines, sevaral issues are found to be blocking (ref https://github.com/joyzoursky/docker-python-chromedriver/issues/31 https://github.com/joyzoursky/docker-python-chromedriver/issues/30).\n\n## Image includes\n - Python (Debian or Alpine based)\n - Google Chrome\n - Chromedriver\n - Selenium (in some versions)\n - Xvfb (in some versions)\n\n## Versions\n\n### Python 3 (Debian-based)\n - `3.9`, `latest` (based on python:3.9, [Dockerfile](https://github.com/joyzoursky/docker-python-chromedriver/blob/master/py-debian/3.9/Dockerfile))\n - `3.9-selenium` (based on python:3.9 with selenium installed, [Dockerfile](https://github.com/joyzoursky/docker-python-chromedriver/blob/master/py-debian/3.9-selenium/Dockerfile))\n - `3.8` (based on python:3.8, [Dockerfile](https://github.com/joyzoursky/docker-python-chromedriver/blob/master/py-debian/3.8/Dockerfile))\n - `3.8-selenium` (based on python:3.8 with selenium installed, [Dockerfile](https://github.com/joyzoursky/docker-python-chromedriver/blob/master/py-debian/3.8-selenium/Dockerfile))\n - `3.7` (based on python:3.7, [Dockerfile](https://github.com/joyzoursky/docker-python-chromedriver/blob/master/py-debian/3.7/Dockerfile))\n - `3.7-selenium` (based on python:3.7 with selenium installed, [Dockerfile](https://github.com/joyzoursky/docker-python-chromedriver/blob/master/py-debian/3.7-selenium/Dockerfile))\n - `3.6` (based on python:3.6, [Dockerfile](https://github.com/joyzoursky/docker-python-chromedriver/blob/master/py-debian/3.6/Dockerfile))\n - `3.6-selenium` (based on python:3.6 with selenium installed, [Dockerfile](https://github.com/joyzoursky/docker-python-chromedriver/blob/master/py-debian/3.6-selenium/Dockerfile))\n\n### Python 3 (Alpine-based)\n- `3.9-alpine` (based on python:3.9-alpine, [Dockerfile](https://github.com/joyzoursky/docker-python-chromedriver/blob/master/py-alpine/3.9-alpine/Dockerfile))\n- `3.9-alpine-selenium` (based on python:3.9-alpine with selenium installed, [Dockerfile](https://github.com/joyzoursky/docker-python-chromedriver/blob/master/py-alpine/3.9-alpine-selenium/Dockerfile))\n- `3.8-alpine` (based on python:3.8-alpine, [Dockerfile](https://github.com/joyzoursky/docker-python-chromedriver/blob/master/py-alpine/3.8-alpine/Dockerfile))\n- `3.8-alpine-selenium` (based on python:3.8-alpine with selenium installed, [Dockerfile](https://github.com/joyzoursky/docker-python-chromedriver/blob/master/py-alpine/3.8-alpine-selenium/Dockerfile))\n- `3.7-alpine` (based on python:3.7-alpine, [Dockerfile](https://github.com/joyzoursky/docker-python-chromedriver/blob/master/py-alpine/3.7-alpine/Dockerfile))\n- `3.7-alpine-selenium` (based on python:3.7-alpine3.8 with selenium installed, [Dockerfile](https://github.com/joyzoursky/docker-python-chromedriver/blob/master/py-alpine/3.7-alpine-selenium/Dockerfile))\n- `3.6-alpine` (based on python:3.6-alpine, [Dockerfile](https://github.com/joyzoursky/docker-python-chromedriver/blob/master/py-alpine/3.6-alpine/Dockerfile))\n- `3.6-alpine-selenium` (based on python:3.6-alpine with selenium installed, [Dockerfile](https://github.com/joyzoursky/docker-python-chromedriver/blob/master/py-alpine/3.6-alpin-selenium/Dockerfile))\n\n### Python 2 (Deprecated)\n\n - `2.7` (based on python:2.7, [Dockerfile](https://github.com/joyzoursky/docker-python-chromedriver/blob/master/deprecated/py2.7/Dockerfile))\n - `2.7-selenium` (based on python:2.7 with selenium installed, [Dockerfile](https://github.com/joyzoursky/docker-python-chromedriver/blob/master/deprecated/py2.7-selenium/Dockerfile))\n - `2.7-alpine3.7` (based on python:2.7-alpine3.7, [Dockerfile](https://github.com/joyzoursky/docker-python-chromedriver/blob/master/deprecated/py2.7-alpine3.7/Dockerfile))\n - `2.7-alpine3.7-selenium` (based on python:2.7-alpine3.7 with selenium installed, [Dockerfile](https://github.com/joyzoursky/docker-python-chromedriver/blob/master/deprecated/py2.7-alpine3.7-selenium/Dockerfile))\n\n### Versions with Xvfb (Deprecated)\n- `3.6-xvfb` (based on python:3.6 with xvfb installed, [Dockerfile](https://github.com/joyzoursky/docker-python-chromedriver/blob/master/deprecated/py3.6-xvfb/Dockerfile))\n- `3.6-xvfb-selenium` (based on python:3.6 with xvfb and selenium installed, [Dockerfile](https://github.com/joyzoursky/docker-python-chromedriver/blob/master/deprecated/py3.6-xvfb-selenium/Dockerfile))\n- `2.7-xvfb` (based on python:2.7 with xvfb installed, [Dockerfile](https://github.com/joyzoursky/docker-python-chromedriver/blob/master/deprecated/py2.7-xvfb/Dockerfile))\n- `2.7-xvfb-selenium` (based on python:2.7 with xvfb and selenium installed, [Dockerfile](https://github.com/joyzoursky/docker-python-chromedriver/blob/master/deprecated/py2.7-xvfb-selenium/Dockerfile))\n\n\n## Usage\n\nFor the following Debian-based images:\n- `latest`\n- `3.9`\n- `3.9-selenium`\n- `3.8`\n- `3.8-selenium`\n- `3.7`\n- `3.7-selenium`\n- `3.6`\n- `3.6-selenium`\n- `3.6-xvfb`\n- `3.6-xvfb-selenium`\n- `2.7`\n- `2.7-selenium`\n- `2.7-xvfb`\n- `2.7-xvfb-selenium`\n\nRun the followings in your terminal:\n\n```\n$ cd [your working directory]\n$ docker run -it -w /usr/workspace -v $(pwd):/usr/workspace joyzoursky/python-chromedriver:[version] bash\n```\n\nFor the following Alpine-based images:\n- `3.9-alpine`\n- `3.9-alpine-selenium`\n- `3.8-alpine`\n- `3.8-alpine-selenium`\n- `3.7-alpine`\n- `3.7-alpine-selenium`\n- `3.6-alpine`\n- `3.6-alpine-selenium`\n- `2.7-alpine`\n- `2.7-alpine-selenium`\n\nRun the followings in your terminal:\n\n```\n$ cd [your working directory]\n$ docker run -it -w /usr/workspace -v $(pwd):/usr/workspace joyzoursky/python-chromedriver:[version] sh\n```\n\nThis will create a container from the image. Then you could starting running the commands in the container as in your working directory. The followings are some examples to run a selenium test.\n\n## Examples to run selenium test in the container\n\nYou can download a selenium test example from [here](https://github.com/joyzoursky/docker-python-chromedriver/blob/master/test_script.py) to quick start.\n\nFor the following images with selenium pre-installed:\n- `3.9-alpine-selenium`\n- `3.9-selenium`\n- `3.8-alpine-selenium`\n- `3.8-selenium`\n- `3.7-alpine-selenium`\n- `3.7-selenium`\n- `3.6-alpine-selenium`\n- `3.6-selenium`\n- `2.7-alpine-selenium`\n- `2.7-selenium`\n\nYou may run:\n\n```\n# python test_script.py\n```\n\nFor the following images that do not have selenium pre-installed:\n- `latest`\n- `3.9-alpine`\n- `3.9`\n- `3.8-alpine`\n- `3.8`\n- `3.7-alpine`\n- `3.7`\n- `3.6-alpine`\n- `3.6`\n- `2.7-alpine`\n- `2.7`\n\nYou may run:\n\n```\n# pip install selenium\n# python test_script.py\n```\n\nFor `3.6-xvfb` or `2.7-xvfb`, you may run:\n\n```\n# pip install selenium\n# xvfb-run --server-args=\"-screen 0 1024x768x24\" python test_script.py\n```\n\nFor `3.6-xvfb-selenium` or `2.7-xvfb-selenium`, you may run:\n\n```\n# xvfb-run --server-args=\"-screen 0 1024x768x24\" python test_script.py\n```\n\nThen you should see the test result like this:\n\n```\ntest_case_1 (__main__.TestTemplate)\nFind and click top-left logo button ... ok\ntest_case_2 (__main__.TestTemplate)\nFind and click top-right Start your project button ... ok\n\n----------------------------------------------------------------------\nRan 2 tests in 11.852s\n\nOK\n```\n\n## Contributing\n\nTo make changes upon the existing Dockerfiles, you are suggested to edit upon the `Dockerfile.template` files, and generate the new Dockerfiles for different versions by running `render.sh`.\n\n### How to edit and generate new versions of Dockerfiles\n\n1. `cd` to the folder that you want to edit, e.g. `py-debian`\n2. Make changes upon `Dockerfile.template` or `Dockerfile-selenium.template`\n3. Run `bash render.sh` from command-line\n\nNote: The `render.sh` is written for Mac OS; If you are using Windows or other OS, some commands may need to be optimised before running.\n\nThanks a lot for helping on improving this project!\n","funding_links":[],"categories":["Dockerfile"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoyzoursky%2Fdocker-python-chromedriver","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjoyzoursky%2Fdocker-python-chromedriver","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoyzoursky%2Fdocker-python-chromedriver/lists"}