Last active
August 17, 2018 11:52
-
-
Save thomas-p-wilson/86efe87c387ed7f2a81f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# Originally found at https://github.com/mark-adams/docker-chromium-xvfb/blob/master/images/base/xvfb-chromium | |
# and modified to work with google-chrome instead of chromium | |
_kill_procs() { | |
kill -TERM $chrome | |
wait $chrome | |
kill -TERM $xvfb | |
} | |
# Setup a trap to catch SIGTERM and relay it to child processes | |
trap _kill_procs SIGTERM | |
XVFB_WHD=${XVFB_WHD:-1280x720x16} | |
# Start xvfb | |
Xvfb :99 -ac -screen 0 $XVFB_WHD -nolisten tcp & | |
xvfb=$! | |
export DISPLAY=:99 | |
google-chrome --no-sandbox $@ & | |
chrome=$! | |
wait $chrome | |
wait $xvfb |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment