Skip to content

Instantly share code, notes, and snippets.

@nicholaslck
Last active April 23, 2020 09:07
Show Gist options
  • Save nicholaslck/62e74d8db4ac095f3beca659ad82febe to your computer and use it in GitHub Desktop.
Save nicholaslck/62e74d8db4ac095f3beca659ad82febe to your computer and use it in GitHub Desktop.
Shell script to install selenium grid on docker.
#!/bin/bash
SNAPSHOT="3.141.59-20200409"
docker network create selenium-grid
docker run -d -p 4444:4444 --net selenium-grid --name selenium-hub \
--health-cmd='/opt/bin/check-grid.sh --host 0.0.0.0 --port 4444' \
--health-interval=15s --health-timeout=30s --health-retries=5 \
selenium/hub:$SNAPSHOT
#### Uncomment this following line to enable Chrome node ####
docker run -d --net selenium-grid --name selenium-chrome-node -e HUB_HOST=selenium-hub -e START_XVFB=false -v /dev/shm:/dev/shm selenium/node-chrome:$SNAPSHOT
#### Uncomment this following line to enable Firefox node ####
# docker run -d --net selenium-grid --name selenium-firefox-node -e HUB_HOST=selenium-hub -e START_XVFB=false -v /dev/shm:/dev/shm selenium/node-firefox:$SNAPSHOT
#### Uncomment this following line to enable Opera node ####
# docker run -d --net selenium-grid --name selenium-opera-node -e HUB_HOST=selenium-hub -e START_XVFB=false -v /dev/shm:/dev/shm selenium/node-opera:$SNAPSHOT
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment