diff --git a/README.md b/README.md index 47371cc37..007fb0b05 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,19 @@ Using the binary from the Chromium snapshot bucket $ docker run -it --rm -p=0.0.0.0:9222:9222 --name=chrome-headless -v /tmp/chromedata/:/data alpeware/chrome-headless-trunk ``` +With custom Chrome options: + +``` +$ docker run -it --rm -p=0.0.0.0:9222:9222 --name=chrome-headless -v /tmp/chromedata/:/data -e "CHROME_OPTS=--other-options" alpeware/chrome-headless-trunk +``` + +For operations not compatible with debug mode, include the NODEBUG variable: + +``` +$ docker run -it --rm -e "NODEBUG=1" -e "CHROME_OPTS=--dump-dom https://google.com" alpeware/chrome-headless-trunk +``` + + Inspired by - [beaufortfrancois](https://github.com/beaufortfrancois/download-chromium) - [National Library of Norway](https://github.com/nlnwa/docker-chrome-headless) diff --git a/start.sh b/start.sh index 3fc328f44..c9227a95b 100755 --- a/start.sh +++ b/start.sh @@ -3,7 +3,11 @@ # Run the NSSDB updating utility in background import_cert.sh $HOME & -CHROME_ARGS="--disable-gpu --headless --no-sandbox --remote-debugging-address=$DEBUG_ADDRESS --remote-debugging-port=$DEBUG_PORT --user-data-dir=/data --disable-dev-shm-usage" +if [ -z "$NODEBUG" ]; then + DEBUG_OPTS="--remote-debugging-address=$DEBUG_ADDRESS --remote-debugging-port=$DEBUG_PORT" +fi + +CHROME_ARGS="--disable-gpu --headless --no-sandbox $DEBUG_OPTS --user-data-dir=/data --disable-dev-shm-usage" if [ -n "$CHROME_OPTS" ]; then CHROME_ARGS="${CHROME_ARGS} ${CHROME_OPTS}"