Run the chromium on headless mode in alpine linux container with google fonts.
$ cd docker/file/path/here
$ docker build -t headless-chromium-alpine:1.0 .
* If you don't need to install google fonts, comment out theRUN
instruction in the next line of the# Install google fonts
from the Dockerfile.
-
Take a screenshot
$ docker run -it --rm -v $(pwd):/home/chromium/work --name headless-chromium headless-chromium-alpine:1.0 --screenshot --window-size=1920,1080 --hide-scrollbars https://github.com/
-
Dump DOM
docker run -it --rm --name headless-chromium headless-chromium-alpine:1.0 --dump-dom https://github.com/
-
Enable devtools
$ docker run --init --rm --rm -d -p 9222:9222 -v $(pwd):/home/chromium/work --name headless-chromium headless-chromium-alpine:1.0 --remote-debugging-port=9222 --remote-debugging-address=0.0.0.0
* It is assumed to operate via WebSocket.
* The container will continue to run until it's terminated.
-
Headress remote debugging
http://localhost:9222/ -
Remote debugging info
http://localhost:9222/json